[Rails] Re: how to run linux command in rake file

2008-11-21 Thread Vamsi Krishna
Gabriel Laskar wrote: > On Thu, Nov 20, 2008 at 3:06 PM, Vamsi Krishna > <[EMAIL PROTECTED]> wrote: >> >> but today_count returns 'true' instead of count. > normal, system() return true or false only, not stdout... > > you can use ``, popen, or code that in ruby. > > today_count = File.open('oc

[Rails] Re: how to run linux command in rake file

2008-11-21 Thread Gabriel Laskar
On Thu, Nov 20, 2008 at 3:06 PM, Vamsi Krishna <[EMAIL PROTECTED]> wrote: > > hi all, > > i need to grep a word count from a text file and i want to display the > count. > i need all the above in a rake file , i tried it by using > > today_count= system("grep -R 'time' oct_10.txt | grep -R 'hi

[Rails] Re: how to run linux command in rake file

2008-11-21 Thread MatthewRudy
On Nov 20, 2:55 pm, Jeff <[EMAIL PROTECTED]> wrote: > p.s. Please don't say "reply ASAP" when posting. Everyone here is > donating their free time and energy already. :-) Fred Cheung wrote a little article on his blog about that; http://spacevatican.org/2008/11/20/asap "Things most likely to mak

[Rails] Re: how to run linux command in rake file

2008-11-21 Thread Judy Khoo
How can I unsubscribe this? Judy> Date: Fri, 21 Nov 2008 10:45:33 +0100> From: [EMAIL PROTECTED]> To: rubyonrails-talk@googlegroups.com> Subject: [Rails] Re: how to run linux command in rake file> > > Vamsi Krishna wrote:> > hi all,> > > > i need to gr

[Rails] Re: how to run linux command in rake file

2008-11-21 Thread Anil Rak
Vamsi Krishna wrote: > hi all, > > i need to grep a word count from a text file and i want to display the > count. > i need all the above in a rake file , i tried it by using > >today_count= system("grep -R 'time' oct_10.txt | grep -R 'hi' | wc > -l") >puts "today count is :#{today_cou

[Rails] Re: how to run linux command in rake file

2008-11-20 Thread Jeff
On Nov 20, 8:06 am, Vamsi Krishna <[EMAIL PROTECTED]> wrote: > hi all, > >  i need to grep a word count from a text file and i want to display the > count. >  i need all the above in a rake file , i tried it by using > >    today_count= system("grep -R 'time' oct_10.txt | grep -R 'hi' | wc > -l")