From: Terry Poulin Date: 2007-08-29T08:17:36+09:00 Subject: Re: ruby shell? Marc Heiler wrote: > Where you can think of your whole operating system as > interacting objects doing nice little stuff (without > being restricted to the old unix philosophy of using > tiny non-GUI thingies with odd names to achieve certain > tasks...) Text is a universal format unless you are a computer. > > > > > "Imagine a new distro or two of linux: Rinux!!" > Oh please... not another one !!! > A shell would be much more of a mundane task ;-) > I once tried to write a shell in Ruby as a toy project in my ~/Programming/Ruby directory but got bored... If it had not all ready been largely done in C, Perl, Lisp, and KornShell versions I'd probably work on a shell and posix oriented userland for fun. > > > "I tend to look at things very pragmatically - if you want to write > something that will run _anywhere_, write a sh script." > > I think being pragmatic is very good. Personally though, > I feel sh style is not only old and ugly - it is a lot > more limited than ruby. I havent seen DSLs usage or GUI > handling in shell scripts, new ideas seem to neither spread > into shell and its "legacy" so to me its a pretty dead > concept - I always have ruby ready, and even if i carry > it around on an USB stick ... :-) > The scripts i write are _bourne_ shell scripts, so they should generally work on almost any system with a compliant shell as long as all of the used programs are installed. I *never* write BASH scripts or use GNU extensions.... The point is it's a shell for interacting with the computer! It just happens to be scriptable, which can be used to create very useful tools. It's not really meant to be a full programming language so much as it is there to enable you to build useful utilities without being a Master Coder. The Bourne Again and Korn Shells add a lot of things to shell scripting, Many Unix utilities have been rewritten as Korn Shell scripts and it even can be made to provide some interfaces for GUI work. ksh93 may as well be a complete _programming language_ unlike POSIX Compatible Bourne shell scripts > But sure, shell scripts may have several use cases, even > perl hasn't killed off shell scripts! (But then again > Perl also has no maintained perl shell afaik) ;-) Personally I think perl scripts are better then sh but there are some applications on most Unix systems that are to good not to reuse for some tasks. If you need to script the operating system, I would say go for the highest level of shell script you can (e.g. ksh93, ksh88, bourne, bash or powershell, cmd, command e.t.c.). If your wanting to port it between OS families, time for a _true_ and complete programming language meant for Programming. Perl is present on almost any Unix like system these days, *BSD and Linux/GNU systems generally include them in the base, Mac OS X might I don't know: Windows is the last bastard not in the heap !!! So it would be a good choice as fewer systems would require it installed. I think the Perl Shells (psh) last release was 21 Jul 2007 on CPAN. I'm a zsh man but I used to collect different shells, languages, terminal emulators, window managers, and text editors :-) I'm very tempted to install Ruby on my server because I enjoy working in Ruby. The only problem is when the Public Domain ksh and Perl pre-installed it's hard to warrant it. And my administration-side tasks don't really require a new tool, even if it would be my favorite :'( TerryP. -- Email and shopping with the feelgood factor! 55% of income to good causes. http://www.ippimail.com