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/$PASSWD
select * from tab;
exit
EOF

$ chmod +x test5.sh
$ ./test5.sh

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

$ echo 'iamwangnc' > u_test.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 +x test6.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

 

相关文章
|
11月前
|
Shell Linux
Linux Shell脚本调试方法
Linux Shell脚本调试方法
111 0
|
11月前
|
运维 Shell
运维(15)-shell脚本的调试方法
运维(15)-shell脚本的调试方法
74 0
|
5月前
|
Kubernetes Shell Linux
linux|shell脚本|有趣的知识---格式化输出日志和脚本调试方法以及kubernetes集群核心服务重启和集群证书备份脚本
linux|shell脚本|有趣的知识---格式化输出日志和脚本调试方法以及kubernetes集群核心服务重启和集群证书备份脚本
198 0
|
3月前
|
Java Shell Linux
使用 sh -x 进行 shell 脚本调试
使用 sh -x 进行 shell 脚本调试
81 9
使用 sh -x 进行 shell 脚本调试
|
Shell Linux
Linux下Shell脚本的调试
这篇博文是对Debugging Shell Scripts in Linux的翻译,希望能帮助到在Linux下写Shell脚本的童鞋。 大多数编程语言都有可用的调试工具,调试工具可用在执行程序或脚本的时候让你检查其内部是如何进行的。对于Shell脚本,我们没有任何可用的调试工具,唯一有的是通过命令行的标识(-n,-v和-x)来辅助我们调试脚本。
99 0
|
Shell 开发工具
关于 SAP Spartacus Shell App 客户应用的调试
关于 SAP Spartacus Shell App 客户应用的调试
|
Shell Linux 开发工具
在 Shell 脚本中跟踪调试命令的执行
在 Shell 脚本中跟踪调试命令的执行
171 0
|
Shell Linux
在 Shell 脚本中执行语法检查调试模式
在 Shell 脚本中执行语法检查调试模式
159 0
|
存储 Shell Linux
Linux 中启用 Shell 脚本的调试模式
Linux 中启用 Shell 脚本的调试模式
141 0
|
NoSQL IDE Shell
【Linux】【Shell】常用调试手段一览
【Linux】【Shell】常用调试手段一览
313 0