anyera has asked for the wisdom of the Perl Monks concerning the following question:
line =08 * * 3 /data/reports/bin/xyz.ksh -o customreports.com -f abc.sql -m xyz.com -c -g
file:- abc.crontab
08 * * 3 /data/reports/bin/xyz.ksh -o customreports.com -f abc.sql -m xyz.com -c -g
06 * * 3 /data/reports/bin/xyz.ksh -o customreports.com -f abc.sql -m xyz.com -c -g
I have searched the line using following command
grep -F "08 * * 3" abc.crontab | grep "abc.sql"
I get the first line from file,I want to delete the exact matching line from abc.crontab
If I use sed -e '/abc.sql /d' abc.crontab/
$cmdperl ="perl -i -nle 'print if !/abc.sql/' abc.crontab ";
then both the lines get deleted from file. Please suggest me the solution.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: delete line from pattern matching
by davido (Cardinal) on Jun 18, 2012 at 16:49 UTC | |
|
Re: delete line from pattern matching
by 7stud (Deacon) on Jun 18, 2012 at 19:54 UTC |