Eckert, Doug
2015-Apr-24 12:42 UTC
[CentOS] Real sh? Or other efficient shell for non-interactive scripts
It was the mid/late-90s, but I seem to recall Bourne being the default shell, although sh/ksh/csh were all available with a typical install. On Fri, Apr 24, 2015 at 8:32 AM, Scott Robbins <scottro at nyc.rr.com> wrote:> On Fri, Apr 24, 2015 at 08:02:56AM -0400, mark wrote: > > On 04/24/15 06:57, Pete Geenhuizen wrote: > > > > > >On 04/24/15 06:07, E.B. wrote: > > >>I'm sure most people here know about Dash in Debian. Have there > > >>been discussions about providing a more efficient shell in Centos > > >>for use with heavily invoked non-interactive scripts? > > >> > > >>Are there other people who have experience in this and can > > >>provide interesting guidance? > > >> > > >Why go to that extreme if you tell a script on line 1 which shell to > run it > > >will do so. > > >#!/bin/dash > > >or what ever shell you want it to run in. I always do that to make > sure that > > >the script runs as expected, if you leave it out the script will run in > > >whatever environment it currently is in. > > > > > > > I'm confused here, too, and this has been bugging me for some time: > > why sh, when almost 20 years ago, at places I've worked, production > > shell scripts went from sh to ksh. It was only after I got into the > > CentOS world in '09 that I saw all the sh scripts again. > > Wasn't Solaris, which for awhile at least, was probably the most popular > Unix, using ksh by default? > > > -- > Scott Robbins > PGP keyID EB3467D6 > ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 ) > gpg --keyserver pgp.mit.edu --recv-keys EB3467D6 > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- *Doug Eckert* *Technical Architect* *Global Business Technology* *Dow Jones* | *A News Corporation Company* P.O. Box 300 | Princeton NJ 08543-0300 (W) 609.520.4993 (C) 732.666.3681 *Email: **doug.eckert at dowjones.com* <alias at dowjones.com>
Pete Geenhuizen
2015-Apr-24 12:54 UTC
[CentOS] Real sh? Or other efficient shell for non-interactive scripts
Initially Bourne was used because it was typically a static binary, because the boot process didn't have access to any shared libraries. When that changed it became a bit of a moot point, and you started to see other interpreters being used. Even though Solaris started using ksh as the default user environment, almost all of the start scrips were either bourne or bash scripts. With Bash having more functionality the scripts typically used the environment that suited the requirements best. Bottom line is use what ever script suits your needs just be sure to tell the environment which interpreter to use. Personally I never write a script that doesn't include the interpreter on the first line. Pete On 04/24/15 08:42, Eckert, Doug wrote:> It was the mid/late-90s, but I seem to recall Bourne being the default > shell, although sh/ksh/csh were all available with a typical install. > > On Fri, Apr 24, 2015 at 8:32 AM, Scott Robbins <scottro at nyc.rr.com> wrote: > > >-- If money can fix it, it's not a problem. -- Click and Clack the Tappet brothers
Stephen Harris
2015-Apr-24 13:08 UTC
[CentOS] Real sh? Or other efficient shell for non-interactive scripts
On Fri, Apr 24, 2015 at 08:54:48AM -0400, Pete Geenhuizen wrote:> Even though Solaris started using ksh as the default user environment, > almost all of the start scrips were either bourne or bash scripts. With > Bash having more functionality the scripts typically used the > environment that suited the requirements best.Bash is a better command shell for many people, but ksh has better scripting ability (eg typescript options bash has never seen). Many Solaris provided scripts were ksh. Bash was bigger than ksh in the non-commercial Unix world because of ksh88 licensing problems. Back in 1998 I wanted to teach a ksh scripting course to my local LUG, but AT&T (David Korn himsef!) told me I couldn't give people copies of the shell to take home. (Finally, too late in the day, they changed their licensing). -- rgds Stephen
Joerg Schilling
2015-Apr-24 13:12 UTC
[CentOS] Real sh? Or other efficient shell for non-interactive scripts
Pete Geenhuizen <pete at geenhuizen.net> wrote:> Initially Bourne was used because it was typically a static binary, > because the boot process didn't have access to any shared libraries. > When that changed it became a bit of a moot point, and you started to > see other interpreters being used.When dynamic linking was intruduced in 1988, people did kno know what we now know and provided sh, mv, tar, ifconfig and mount as statib binaries in "/sbin". Since Solaris 10 we know better and there is no static binary anymore. BTW: the real Bourne Shell is now 100% portable and enhanced since a longer time. If you like to test the real Bourne Shell, check the latest schilytools: https://sourceforge.net/projects/schilytools/files/ The Bourne Shell is also much faster than bash. In special on platforms like Cygwin, where Microsoft enforces extremly slow process creation.> Even though Solaris started using ksh as the default user environment, > almost all of the start scrips were either bourne or bash scripts. With > Bash having more functionality the scripts typically used the > environment that suited the requirements best.There are no bash scripts on Solaris as bash has too many deviatioons from the standard. J?rg -- EMail:joerg at schily.net (home) J?rg Schilling D-13353 Berlin joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/'
Apparently Analagous Threads
- Real sh? Or other efficient shell for non-interactive scripts
- Real sh? Or other efficient shell for non-interactive scripts
- Real sh? Or other efficient shell for non-interactive scripts
- Real sh? Or other efficient shell for non-interactive scripts
- Real sh? Or other efficient shell for non-interactive scripts