aix 5系统有一个脚本,脚本的内容如下db2 connect to dbname user name using passv_date=`db2 -x "select time from db2inst1.s_time"`echo $v_datedb2 connect reset现在的问题是,手工执行脚本sh aa.sh没问题,但是用crontab调度此脚本,$v_date日期输出为空,取不到日期,这是什...显示全部
aix 5系统 有一个脚本,脚本的内容如下 db2 connect to dbname user name using pass v_date=`db2 -x "select time from db2inst1.s_time"` echo $v_date db2 connect reset
在crontab中运行shell脚本,需要你在shell脚本的开头添加数据库的db2profile信息,比如 if [ -f /home/sqllib/db2profile ]; then . /home/sqllib/db2profile fi db2 connect to dbname user name using pass v_date=`db2 -x "select time from db2inst1.s_time"` echo $v_date db2 connect reset 这个shell内容就可以了