PATH覆盖问题
条件语句
-
TEST_PATH=testnamepath
echo "mysqldump -h 127.0.0.1 -uroot -psunland@2011 testlink
>/home/test/try/.\$(date -d\"today\" +\"%Y%m%d_%H%M%S\")" >$TEST_PATH
reslut=$?
echo "create testlink.sql $reslut"
ps aux|grep "crond"
if [ $reslut==0 ]; then
echo "ok"
else
echo "flase"
fi
echo $?>>log.doing
[popexizhi]
1.郁闷了很久之前,每次执行都提示“ ./1.sh:
line 7: ls: command not found ”
后来发现是定义的自己定义的PATH覆盖了系统定义的PATH,当然无法在找到ls了。嘻嘻,修改变量名称为TEST_PATH,就ok了。
看来下一个任务了解linux下的环境变量定义内容了:)
2.嘻嘻判断语句一直写的是
if [$reslut ==0] ;then
在[ 与$result中没有空格,所以运行时提示:“[0: command not found”
增加空格就ok了:) 要注意的小问题好多啊!刚开始,嘻嘻,继续,继续!
没有评论:
发表评论