Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 1996 10:51:05 +0000 (GMT)
From:      Gabor Zahemszky <zgabor@CoDe.hu>
To:        freebsd-questions@freebsd.org
Cc:        softweyr@xmission.com
Subject:   Re: Shells shells shells?
Message-ID:  <199609231051.KAA01945@CoDe.CoDe.hu>
In-Reply-To: <199609201350.HAA03020@obie.softweyr.com> from "Wes Peters" at Sep 20, 96 07:50:29 am

next in thread | previous in thread | raw e-mail | index | archive | help
<snip>

> For writing shell scripts, I usually stick to /bin/sh, as it is the
> *most* portable shell across UNIX systems -- they all have at least
> that one.  ;^)

And of course, you don't use some interesting feature of /bin/sh in FBSD,
which is more like a POSIX-shell, than an original Bourne-shell.  Eg:
a)
original Bourne-shell hasn't got aliases.  It hasn't got command-line
editing (OK, it's not a programming feature);
b)
it has functions only in the
newer versions, and these functions run after internal commands, not before
them (what about this one:
$ cd()
> echo Hi!
$ cd /tmp
Hi!
$ 
);
c)
original sh hasn't got chdir, only cd, so you cannot make a new cd
command, which change the directory, and change your prompt to $PWD
(well, you can use it, if there is csh-like alias command, or the functions
run before builtin commands - as with FBSD's sh);
d)
it cannot use the $(...) form of command substitution (aka `...`);
it hasn't got a $((..)), so you have to write:
i=`expr $i + 1`
instead of 
i=$(( $i + 1 ))
(well, modern shell's doesn't need the $ at all in the $i)
e)
it hasn't got set -o, and most of the features of it;
f)
it cannot cd -
g)
it can unset a shell-variable with a=, not with unset a;
(well, it's very old form)
h)
it has a type builtin command, which is missing from FBSD's sh, which can
say, what type of a command (like which in csh, whence in ksh, and type in bash,
but it says the body of a function, too - if in that shell, there are functions)
i)
it hasn't got <> redirection
j)
it doesn't know the ! reserved word

and so on;  would you like some more?  Well, mail me, and I will search for
another differences.  Now, I don't know more.  Opps, sh's hasn't got getopts,
they can use only getopt (some of them has getopt builtin, some of them has
getopt external)

(Well, some of these features missing from Bourne-shell's of pre-SVR2, but
some of them are missing from modern Unices' sh.)

-- 
	Gabor Zahemszky <zgabor@CoDe.hu>

-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-
Earth is the cradle of human sense, but you can't stay in the cradle forever.
						Tsiolkovsky



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609231051.KAA01945>