[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron and command quote



T o n g <mlist4suntong@yahoo.com>:
> 
>  I.e., somehow, the 'ps | grep' was able to find something in cron, whereas
>  when executed directly under shell:
> 
>   $ ps -eaf | grep -E 'cdrecord.* -[dts]ao |cdrdao *write|growisofs.*speed='
> 
>   $ /bin/sh -c "ps -eaf | grep -E 'cdrecord.* -[dts]ao |cdrdao *write|growisofs.*speed='"
> 
>  I.e., if the same command are executed directly under shell the 
>  'ps | grep' finds nothing. 
> 
>  Anyone can give some explanation?

Yes.  you're stressing either the tool, or your knowledge of it.  Put
the relevant bits in a shell script and tell cron to execute that.
Then you'll have full control.  It won't be hampered by cron's (by
design) limitations.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*)    http://blinkynet.net/comp/uip5.html      Linux Counter #80292
- -    http://www.faqs.org/rfcs/rfc1855.html    Please, don't Cc: me.


Reply to: