in reply to parsing crontab output

Something like this, perhaps?
#!/usr/bin/perl -w my $crontab=`crontab -l`; foreach (split(/\n/,$crontab)) { next if /^#/; my @arr=split(/\s+/,$_); $arr[5]=join(" ",splice(@arr,5)); # join the command line into a sin +gle element @arr=map(/,/?"\"$_\"":$_,@arr); # quote fields with commas print join(",",@arr)."\n"; }
This code has been tested, but not on animals.

Replies are listed 'Best First'.
Re: Re: parsing crontab output
by Anonymous Monk on Apr 09, 2004 at 18:10 UTC
    thank you very much for your quick response. this is very helpful