Matthew PATTISON wrote: > Hi, > > I was wondering, maybe this has been discussed before and dismissed, how > hard would it be to write a Unix/Linux shell whose language was Ruby, or a > slight variant. Basically if performance wasn't an issue this could sit on top > of another shell (eg. bash/sh), and wrap commands, and any variance needed in > the syntax could be achieved via a preprocessor. I think some people > are/were doing this with Perl, although I don't know how serious an attempt > it is/was. I just think it would be very cool to have so much power in my > command line. Please tell me if I'm being crazy. > > Matt Pattison > > * Hal E. Fulton (hal9000 / hypermetrics.com) [001024 01:05]: > > ----- Original Message ----- > > From: Dat Nguyen <thucdat / hotmail.com> > > To: ruby-talk ML <ruby-talk / netlab.co.jp> > > Sent: Monday, October 23, 2000 6:27 AM > > Subject: [ruby-talk:5787] Shells and Ruby > > > > > > > Hello all, > > > > > > Is there anything that shells (Korn, C, Bash, Bourne, etc.), awk, sed, > > etc. > > > can do but Ruby can't? > > > > > > Thanks, > > > Dat > > > > Well, as far as I know, Ruby can do everything that ksh > > can, but perhaps not always as conveniently. > > > > I investigated using method_missing to treat OS commands > > as (missing) methods and then pass them with their args > > to the OS. But Ruby methods have commas separating > > their parameters. So it's not as simple as that. > > > > In short, it's easier to run an external program from ksh > > than from Ruby. That's my only thought so far. > > > > Hal > > > > > > Actually, my understanding is that most of the shell commands are simple c routines, so it would be a matter of wrapping them directly to Ruby, and cut out the other shell entirely. It supplies the grammar, not the functionality, and you are talking about replacing the grammar. It might not be any speed demon, but it shouldn't be any worse than any other shell. There are several operations that might not be as convenient though, except when you were programming in Ruby. -- (c) Charles Hixson -- Addition of advertisements or hyperlinks to products specifically prohibited