create directory dir_d as '/home/oracle/dir_d';
shell脚本变量为dic_name=$pwd
想在当前目录创建,所以想把/home/oracle替换为变量dic_name
如果没有单引号,直接可以用$dic_name引用
但是有单引号的时候怎么引用呢?
------解决思路----------------------
一样的
也可以写成两个,SQL脚本和SHELL脚本
tmp.sql:
define dic_name=&1
create directory dir_d as '$dic_name/dir_d';
shell脚本:
sqlplus xxx/xxx@xxx<<EOF
@tmp.sql $pwd
EOF