Thread
:
Help with a two line shell script
View Single Post
Benson
2008-07-23 , 14:59
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#
14
On early UNIX, (when the Bourne shell was the most advanced Bourne-compatible shell), it lived as /bin/sh.
Now there are at least three Bourne-compatible shells in common use:
ash - Almquist SHell; this was originally a clone of an some Bourne shell (sysvr4?), and deliberately lacks extended features. (There's
several variants
; we have busybox ash by default.)
bash - Bourne Again SHell; GNU clone of bash with a truckload of features.
ksh - Korn SHell; This is another classic UNIX shell, designed with a focus on scripting, as well as enhanced interactive use from csh, and backwards compatibility to sh. (There's several variants here, too...)
zsh; less commonly used, but attempts to incorporate the benefits of bash, ksh, and tcsh. Most notable use is probably Darwin and derivatives.
On most modern UNIXen, there's no binary at /bin/sh; it's a symlink to some Bourne-compatible shell (usually with extensions). But it's always there, and should always be nominally compatible. So by writing scripts using a portable subset of what your /bin/sh knows, and using /bin/sh as an interpreter, your script can work on any UNIX.
Sven Mascheck has some more info on
portability
, and on shell history in general, at his
site
. Good reading.
But bottom line is: shebang for /bin/sh, and if it runs on ours (busybox ash), it's a decent bet it'll work everywhere else.
__________________
World's first inductively-charged N900!
Quote & Reply
|
The Following 3 Users Say Thank You to Benson For This Useful Post:
buurmas
,
dfinch
,
qwerty12
Benson
View Public Profile
Send a private message to Benson
Find all posts by Benson