how to run linux command in rake file

Try backticks instead:

output = `grep -R 'time' oct_10.txt | grep -R 'hi' | wc`

backticks will return whatever went to stdout.

For system(), rtfm:

p.s. Please don't say "reply ASAP" when posting. Everyone here is
donating their free time and energy already. :slight_smile:

Fred Cheung wrote a little article on his blog about that;

"Things most likely to make me not reply to a message on a mailing

    This is urgent

    Plz reply ASAP"