[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Pipe shell output to ruby -e?

x1

10/22/2006 7:17:00 AM

I know this has been done before but search yields nothing :-
Just wondering how you can pipe output to ruby -e? I tried this but
it doesnt work :-(

#### borked
echo "hello" |ruby -e 'puts ARGV.to_s'



Thanks for any help you may be able to offer.

3 Answers

Bill Kelly

10/22/2006 7:57:00 AM

0

From: "x1" <caldridge@gmail.com>
>
> Just wondering how you can pipe output to ruby -e? I tried this but
> it doesnt work :-(
>
> #### borked
> echo "hello" |ruby -e 'puts ARGV.to_s'

A couple possibilities:

echo hello | ruby -e "puts gets"
echo hello | ruby -e "puts ARGF.read"

ruby -e 'puts ARGV.to_s' `echo hello`


Hope this helps,

Bill



EB

10/22/2006 1:08:00 PM

0

x1 wrote:
> I know this has been done before but search yields nothing :->
> Just wondering how you can pipe output to ruby -e? I tried this but
> it doesnt work :-(
>
> #### borked
> echo "hello" |ruby -e 'puts ARGV.to_s'

echo "hello" | xargs ruby -e 'puts ARGV.to_s'

will also work.

Cheers,

eb


>
>
> Thanks for any help you may be able to offer.
>

x1

10/23/2006 4:30:00 AM

0

Awesome. Thanks so much!

On 10/22/06, EB <ebonakDUH_@hotmail.com> wrote:
> x1 wrote:
> > I know this has been done before but search yields nothing :-> >
> > Just wondering how you can pipe output to ruby -e? I tried this but
> > it doesnt work :-(
> >
> > #### borked
> > echo "hello" |ruby -e 'puts ARGV.to_s'
>
> echo "hello" | xargs ruby -e 'puts ARGV.to_s'
>
> will also work.
>
> Cheers,
>
> eb
>
>
> >
> >
> > Thanks for any help you may be able to offer.
> >
>
>