[CentOS] Real sh? Or other efficient shell for non-interactive scripts

E.B. emailbuilder88 at yahoo.com
Fri Apr 24 20:45:40 UTC 2015


Interesting thread i started! Sorry if my question was too vague: -->

On Fri, 4/24/15, Joerg Schilling <Joerg.Schilling at fokus.fraunhofer.de> wrote:

> The Bourne Shell is also much faster than bash. In special on platforms like
> Cygwin, where Microsoft enforces extremly slow process creation.

This gets at what I was thinking. For scripts that are not run interactively, it
seems wasteful to load all of Bash autocomplete, command history and all
its rich features.

For running in high volume mail server for example, *short* scripts that take
a few input args and invoke another program. Or do a mysql update (but
it has been pointed out invoking mysql from a shell script is also inefficient
since mysql client is also very feature rich with command history and things).
Or take some arguments and make a curl HTTP request somewhere.

So my question is should I install ksh (I see it is available in yum centos
base repo) and use that? Or should we consider to rewrite these short
scripts to perl? I read on the web that perl with a few typical libraries is
far slower to start up than a shell script.  ??  (no heavy computations)

Just a side tangent was question if it would be of interest to link /bin/sh
to something other than /bin/bash, if machine would implode or if it would
make machine faster in any way.

thanks everyone!



More information about the CentOS mailing list