From owner-freebsd-questions Mon Sep 23 01:58:20 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA05904 for questions-outgoing; Mon, 23 Sep 1996 01:58:20 -0700 (PDT) Received: from mail.EUnet.hu (mail.eunet.hu [193.225.28.100]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA05867 for ; Mon, 23 Sep 1996 01:58:13 -0700 (PDT) Received: by mail.EUnet.hu, id KAA09529; Mon, 23 Sep 1996 10:58:04 +0200 Received: by CoDe.CoDe.hu (KAA01945); Mon, 23 Sep 1996 10:51:05 GMT From: Gabor Zahemszky Message-Id: <199609231051.KAA01945@CoDe.CoDe.hu> Subject: Re: Shells shells shells? To: freebsd-questions@freebsd.org Date: Mon, 23 Sep 1996 10:51:05 +0000 (GMT) Cc: softweyr@xmission.com In-Reply-To: <199609201350.HAA03020@obie.softweyr.com> from "Wes Peters" at Sep 20, 96 07:50:29 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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 -:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:- Earth is the cradle of human sense, but you can't stay in the cradle forever. Tsiolkovsky