From owner-freebsd-arch Tue Apr 18 2:18:57 2000 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 7727437BC92 for ; Tue, 18 Apr 2000 02:18:53 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id LAA20728 for ; Tue, 18 Apr 2000 11:13:58 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id LAA00642 for freebsd-arch@freebsd.org; Tue, 18 Apr 2000 11:13:57 +0200 (CEST) Received: from karon.dynas.se (karon.dynas.se [192.71.43.4]) by hub.freebsd.org (Postfix) with SMTP id C19B937B82F for ; Tue, 18 Apr 2000 02:13:50 -0700 (PDT) (envelope-from micke@dynas.se) Received: (qmail 90208 invoked from network); 18 Apr 2000 09:07:08 -0000 Received: from spirit.sto.dynas.se (HELO spirit.dynas.se) (172.16.1.10) by karon.sto.dynas.se with SMTP; 18 Apr 2000 09:07:08 -0000 Received: (qmail 22423 invoked by uid 1101); 18 Apr 2000 09:07:09 -0000 Date: Tue, 18 Apr 2000 11:07:09 +0200 (MET DST) From: Mikael Hybsch X-Sender: micke@spirit.dynas.se To: freebsd-arch@freebsd.org Subject: Re: Shells In-Reply-To: <27309.955883220@zippy.cdrom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 16 Apr 2000, Jordan K. Hubbard wrote: > > What does this mean. If it means that sh scripts won't run on BASH, > > sh scripts run fine on bash and I'll certainly challenge anyone to > find me a /bin/sh script which behaves differently when fed to our > 5.0-current ash shell vs bash 2.03. > That's easy. Below is a /bin/sh line from a product of ours that works on AIX, HP/UX, Solaris and FreeBSD. It does however not work unmodified on Linux. Bash happily aborts the script and complains that UID is a read-only variable :( UID=`id | sed 's/^uid=\([0-9]*\).*/\1/'` If there is a need to have a nice command line interpreter in the source tree it should be installed as /usr/bin/bash (or preferable /usr/bin/zsh). /bin/sh is mainly for scripts. -- Mikael Hybsch Email: mhybsch@rsasecurity.com RSA Security AB Phone: +46-8-7250900 Box 10704 Fax: +46-8-6494970 S-121 29 STOCKHOLM, SWEDEN To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message