% ruby ????-v
(-v? ??????? Ruby? ??? ????? ?????. ??)? ??? ? Enter ?? ????. Ruby? ???? ??? ??? ??? ???? ?????:
% ruby ????-v
ruby 1.6.6 [i586-linux]
Ruby? ???? ?? ??? ??? ? ????. ???? ????? ?? ? ?? ????. Ruby? ??? ?? ??? ?? ?? ????????.
?? Ruby ????? -e ????? ???? ???? ?? ??? ? ????.
% ruby ????-e ' print "hello worldn"'
hello world
????? Ruby ?????
% cat > test.rb
print "hello worldn"
^D
% cat test. rb
print "hello worldn"
% ruby ????test.rb
hello world
^D? UNIX??? ?????.
C: ruby> con: test.rb
print " hello worldn"
^Z
C:ruby> type test.rb
print "hello worldn"
C:ruby> ruby ????test.rb
hello world
? ?? ??? ??? ? ??? ?????? ?? ??? ???? ???? ?? ????.
? ? ?? ?????? ???? ???? ??? ??? ??? ? ????. ?? ??, ?? C ?? ????? ?? ???? foo? bar? ?????. ?? ????? ".bak" ??? ?? ??? ?????:
% ruby ????-i.bak -pe 'sub "foo", "bar"' *.[ch]
? ????? ??? ?????. UNIX??? cat ??(??? cat?? ??? ??):
% ruby ????-pe 0 ??