Hi all, Can anyone tell what is the way to execute OS shell command from within Rails programs? I tried to use "exec" but it terminate the console (which run "ruby script/server" originally). Thank you very much. - Chuong --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Chuong, I''ve used ''open3'' http://www.ruby-doc.org/stdlib/libdoc/open3/rdoc/index.html repeatedly with succes. (used open3 because I needed stdout and stderr) Piet. ________________________________ From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Chuong Huynh Sent: dinsdag 23 januari 2007 11:19 To: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Subject: [Rails] Execute shell command from Rails Hi all, Can anyone tell what is the way to execute OS shell command from within Rails programs? I tried to use "exec" but it terminate the console (which run "ruby script/server" originally). Thank you very much. - Chuong --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
%x{shellcommand}
e.g.
%x{ls -l /}
2007/1/23, Piet Hadermann
<piet.hadermann-/1BeJOKqmzrQT0dZR+AlfA@public.gmane.org>:>
> Hi Chuong,
>
> I''ve used ''open3''
> http://www.ruby-doc.org/stdlib/libdoc/open3/rdoc/index.html repeatedly
> with succes.
> (used open3 because I needed stdout and stderr)
>
> Piet.
>
> ------------------------------
> *From:* rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:
> rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] *On Behalf Of
*Chuong Huynh
> *Sent:* dinsdag 23 januari 2007 11:19
> *To:* rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> *Subject:* [Rails] Execute shell command from Rails
>
> Hi all,
>
> Can anyone tell what is the way to execute OS shell command from within
> Rails programs? I tried to use "exec" but it terminate the
console (which
> run "ruby script/server" originally).
>
> Thank you very much.
>
> - Chuong
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Hi, Thank you for the info. I''ve found out also Kernel.system, IO.popen. I will try them all. - Chuong On 1/23/07, Piet Hadermann <piet.hadermann-/1BeJOKqmzrQT0dZR+AlfA@public.gmane.org> wrote:> > Hi Chuong, > > I''ve used ''open3'' > http://www.ruby-doc.org/stdlib/libdoc/open3/rdoc/index.html repeatedly > with succes. > (used open3 because I needed stdout and stderr) > > Piet. > > ------------------------------ > *From:* rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto: > rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] *On Behalf Of *Chuong Huynh > *Sent:* dinsdag 23 januari 2007 11:19 > *To:* rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > *Subject:* [Rails] Execute shell command from Rails > > Hi all, > > Can anyone tell what is the way to execute OS shell command from within > Rails programs? I tried to use "exec" but it terminate the console (which > run "ruby script/server" originally). > > Thank you very much. > > - Chuong > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---