strange problem : grep ^- in cron is not working [message #97860] |
Tue, 25 March 2003 11:30  |
mani
Messages: 105 Registered: September 1999
|
Senior Member |
|
|
Hi,
I have crontab which initiates the shell called call.sh.
My call.sh is :
var=`ls -ltr |grep ^-|tr -s " "|cut -d " " -f9|grep ^INP|sort`
echo $var
here when i run a crontab am getting the error
call.sh . INP not found.
I think the usage of grep ^ is having some problem while using in crontab.
can ne 1 pls help me..
Thanks in advance
~V~
|
|
|
|
|
Re: strange problem : grep ^- in cron is not working [message #97877 is a reply to message #97860] |
Thu, 03 April 2003 15:33  |
Anand
Messages: 161 Registered: August 1999
|
Senior Member |
|
|
Hi,
What are you trying to achieve through that 'grep' command? Are you filtering out '-' characters and "INP" characters? If so, try 'grep -v'.
Your code would be like this:
`ls -ltr |grep -v '-'|tr -s " "|cut -d " " -f9|grep -v 'INP'|sort`
|
|
|