0
時,我從殼(tcsh的)這個命令,它執行perfectly-錯誤而
cal | tail -6 | sed -e 's/^.\{3\}//' -e 's/.\{3\}$//' | tr -s '[:blank:]' '\n' | head -21 | tail -20 | tr -s '\n' ' ' | grep -w `date "+%e"` ; /usr/bin/bash -lc "if [ "$?" == 0 ] ; then echo xyz ; fi"
但是當我把同樣的事情在一個crontab,我得到從這個錯誤的郵件我的機器
Subject: Output from "cron" command
Content-Length: 244
Your "cron" job on uatserver
cal | tail -6 | sed -e 's/^.\{3\}//' -e 's/.\{3\}$//' | tr -s '[:blank:]' '\n' | head -21 | tail -20 | tr -s '\n' ' ' | grep -w `date "+
produced the following output:
Usage: grep -hblcnsviw pattern file . . .
我敢肯定,連我的crontab命令使用tcsh作爲它被設置爲默認執行。
p.s-我的機器: 的SunOS uatserver 5.10 Generic_127112-11了i86pc I386了i86pc