当前位置: 技术问答>linux和unix
unix 调用问题
来源: 互联网 发布时间:2016-05-04
本文导语: 在/home下有三个文件,a.sh ,b.sh, c.txt, cat a.sh #!/bin/sh echo "nihao" cat b.sh #!/bin/sh ./a.sh > /home/c.txt 在/home内可以直接运行./b.sh 看到c.txt的结果---正确 提问:我想每天上午8:10自动运行 crontab -e 10 8 *...
在/home下有三个文件,a.sh ,b.sh, c.txt,
cat a.sh
#!/bin/sh
echo "nihao"
cat b.sh
#!/bin/sh
./a.sh > /home/c.txt
在/home内可以直接运行./b.sh 看到c.txt的结果---正确
提问:我想每天上午8:10自动运行
crontab -e
10 8 * * * /home/b.sh 不能运行或没有结果,这是为什么?
cat a.sh
#!/bin/sh
echo "nihao"
cat b.sh
#!/bin/sh
./a.sh > /home/c.txt
在/home内可以直接运行./b.sh 看到c.txt的结果---正确
提问:我想每天上午8:10自动运行
crontab -e
10 8 * * * /home/b.sh 不能运行或没有结果,这是为什么?
|
cat b.sh
#!/bin/sh
./a.sh > /home/c.txt // 这里最好用a.sh绝对路径
#!/bin/sh
./a.sh > /home/c.txt // 这里最好用a.sh绝对路径