From: Rob Rypka Date: 2005-11-05T05:07:56+09:00 Subject: Re: how do you do this with ruby? On 11/4/05, casioculture@gmail.com wrote: > In bash, you'd do this with the perl interpreter > > Issue the perl command via -e switches on the shell command line: > perl -e 'print "Hello, world\n"' > > or > > Pass your script to Perl via standard input: > echo "print 'Hello, world'" | perl - > > How would you do the above with the ruby interpreter in bash? s/perl/ruby % ruby -e 'print "Hello, world\n"' Hello, world % echo "puts 'Hello, world'" | ruby - Hello, world I changed the command in the previous one because zsh cuts off the last line for me if there's no newline, but you get the point. The dash isn't necessary in the second example: % echo "puts 'Hello, world'" | ruby Hello, world -- Rob