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.
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
echo “hello” |ruby -e ‘puts ARGV.to_s’
Thanks for any help you may be able to offer.
From: “x1” [email protected]
Just wondering how you can pipe output to ruby -e? I tried this but
it doesnt workborked
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
Awesome. Thanks so much!
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 workborked
echo “hello” |ruby -e ‘puts ARGV.to_s’
echo “hello” | xargs ruby -e ‘puts ARGV.to_s’
will also work.
Cheers,
eb
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs