in reply to parsing crontab output
This code has been tested, but not on animals.#!/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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: parsing crontab output
by Anonymous Monk on Apr 09, 2004 at 18:10 UTC |