Shell连接Oracle
Shell 中使用sqlplus连接Oracle数据库并打印
1 | !/bin/bash |
Shell 中将查询结果写到文件中
1 | sqlplus -silent user_name/user_password@service_name >/home/infa/shell_home/tmp/sql_file.txt <<EOF |
储存到文件的数据如下:

Shell 读取以上文件的并传给对应参数
1 | while read line |
执行结果如下:

1