From: Pat Eyler Date: 2002-04-26T10:32:10+09:00 Subject: Re: Ruby as a "sh" sucessor language On Fri, 26 Apr 2002, Gregory Benjamin wrote: > I'm interested in using ruby as a super replacement for "sh" scripts. > I want to do the same sort of mundane things. Benjamin, please tak a look at 'The Ruby Way' by Hal Fulton (SAMS, ISBN 0-672-32083-5) it has a chapter on scripting and systems administration which should give you a lot of what you mention below. -pate > > Check command line arguments > Make sure files exist > Make sure files are readable > create directories > move files from one place to another > temporarily change directories > scan through files doing awk/perl pattern replacement, extraction > write new files > remove files > run external commands and pipe the results > etc. > > I learn best by example -- sample code is what I'm looking for, > but a book entitled "Using Ruby as a Bourne-shell replacement" > or something similar would be great. > > If I learn some OO stuff along the way that's OK too, but mostly > I want a way to do what one normally does with sh, without using > perl (which I've used a long time but see Ruby as a cleaner approach). > > Thanks >