#!/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 single element @arr=map(/,/?"\"$_\"":$_,@arr); # quote fields with commas print join(",",@arr)."\n"; }