shell中使用sqlplus及调试相关

简介:   五、为了安全要求每次执行shell都手工输入密码$ vi test5.sh#!/bin/bashecho -n "Enter password for u_test:"read PASSWDsqlplus -S /nolog

 

 

五、为了安全要求每次执行shell都手工输入密码
vi test5.sh  #!/bin/bash echo -n "Enter password for u_test:" read PASSWD sqlplus -S /nolog <<EOF conn u_test/vi test5.sh  #!/bin/bash echo -n "Enter password for u_test:" read PASSWD sqlplus -S /nolog <<EOF conn u_test/PASSWD
select * from tab;
exit
EOF

chmod+xtest5.sh ./test5.sh

六、为了安全从文件读取密码
对密码文件设置权限, 只有用户自己才能读写.

echoiamwangnc>utest.txt chmod g-rwx,o-rwx u_test.txt
vi test6.sh  #!/bin/bash PASSWD=`cat u_test.txt` sqlplus -S /nolog <<EOF conn u_test/PASSWD
select * from tab;
exit
EOF

chmod+xtest6.sh ./test6.sh

 

http://blog.sina.com.cn/s/blog_87fad56a0100yjpp.html

http://blog.sina.com.cn/s/blog_8333cf8f0100z7e3.html

http://www.cnblogs.com/softwaretesting/archive/2012/02/06/2339671.html

 

目录
打赏
0
0
0
0
95
分享
相关文章
运维(15)-shell脚本的调试方法
运维(15)-shell脚本的调试方法
97 0
linux|shell脚本|有趣的知识---格式化输出日志和脚本调试方法以及kubernetes集群核心服务重启和集群证书备份脚本
linux|shell脚本|有趣的知识---格式化输出日志和脚本调试方法以及kubernetes集群核心服务重启和集群证书备份脚本
269 0
|
8月前
|
使用 sh -x 进行 shell 脚本调试
使用 sh -x 进行 shell 脚本调试
148 9
使用 sh -x 进行 shell 脚本调试
Linux下Shell脚本的调试
这篇博文是对Debugging Shell Scripts in Linux的翻译,希望能帮助到在Linux下写Shell脚本的童鞋。 大多数编程语言都有可用的调试工具,调试工具可用在执行程序或脚本的时候让你检查其内部是如何进行的。对于Shell脚本,我们没有任何可用的调试工具,唯一有的是通过命令行的标识(-n,-v和-x)来辅助我们调试脚本。
121 0
在 Shell 脚本中执行语法检查调试模式
在 Shell 脚本中执行语法检查调试模式
171 0
Linux 中启用 Shell 脚本的调试模式
Linux 中启用 Shell 脚本的调试模式
168 0
【Linux】【Shell】常用调试手段一览
【Linux】【Shell】常用调试手段一览
358 0
shell中的函数及脚本调试方法
shell中的函数及脚本调试方法
231 0