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?
--
thanks,
-pate
-------------------------
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