From: "Pena, Botp" Date: 2007-08-24T12:43:16+09:00 Subject: Re: ruby shell? From: Felix Windt [mailto:fwmailinglists@gmail.com] # felix@felix-laptop:~$ expr 20 + 5 - 4 # 21 # # Now, I work in the shell all day long, so maybe I'm just used to those # things, but I didn't find them any harder to learn than some # of the ground rules for Ruby. for shell gurus, it probably should not matter. But w the current IT state, of admins beset with multitude of problems amongst a sea of heteregeneous platforms, architecture, networks, os, applications, languages, whatever, we need a tool that is general purpose, kind on our brains, yet powerful to drive a small script up to the the biggest web framework imagineable. eg, botp@botp-desktop:~$ expr 1+1 1+1 botp@botp-desktop:~$ expr 1+.5 1+.5 botp@botp-desktop:~$ expr 1+0.5 1+0.5 ruby on the other hand is kinder,.. botp@botp-desktop:~$ ruby -e "p 1+1" 2 botp@botp-desktop:~$ ruby -e "p 1+.5" -e:1: no . floating literal anymore; put 0 before dot p 1+.5 ^ -e:1: syntax error, unexpected '.' p 1+.5 ^ i see. so ruby is kind to the programmer, providing much error info as possible botp@botp-desktop:~$ ruby -e "p 1+0.5" 1.5 botp@botp-desktop:~$ ruby -e "p 1+0.5+Math::PI" 4.64159265358979 botp@botp-desktop:~$ ruby -e "p r=100; c=Math::PI*r; area=c*r; p area" 100 31415.9265358979 botp@botp-desktop:~$ ruby -e "r=100; c=Math::PI*r; area=c*r; p area" 31415.9265358979 botp@botp-desktop:~$ ruby -e "p 2**999" 535754303593133660474212524530000905280702405852766803721875194185175525 562468061246599189407847929063797336458776573412593572642846157021799228 878734928740196728388741211549271053730253118557093897709107652323749179 097063369938377958277197303853145728559823884327108383021491582631219341 8602834034688 botp@botp-desktop:~$ echo hello, world | ruby -e "p gets.chomp.capitalize" "Hello, world" botp@botp-desktop:~$ rails -v ruby is kind to me, ..or maybe, i'm just getting old and lazy :( kind regards -botp