From: Peter Vandenabeele Date: 2010-12-15T08:06:17+09:00 Subject: Re: Grep a string On Tue, Dec 14, 2010 at 7:53 PM, Brian Candler wrote: > Rajesh M. wrote in post #968323: >>  cat /tmp/cron.list | egrep '^[0-9\*]' >> 00 01 * * 0 (sync ; sync ; sync ; /sbin/reboot) >> 00 18 * * 6 (sync; sync; sync; /sbin/reboot) >> >> Not sure it is still getting digits, what am doing wrong here? The part you may have overlooked is the 'cut' command at the end of $ cat crontab | egrep '^[0-9\*]' | cut -f3- 'egrep' selects the relevant lines (but the _complete_ lines) 'cut' cuts away a part of the lines (that where previously selected with egrep) Anyway, using one of the proposed ruby variants will be much simpler (and more on-topic ...). Peter