From owner-freebsd-questions Sat Jan 26 14:36:46 2002 Delivered-To: freebsd-questions@freebsd.org Received: from lists.blarg.net (lists.blarg.net [206.124.128.17]) by hub.freebsd.org (Postfix) with ESMTP id 8CAE237B402 for ; Sat, 26 Jan 2002 14:36:41 -0800 (PST) Received: from thig.blarg.net (thig.blarg.net [206.124.128.18]) by lists.blarg.net (Postfix) with ESMTP id 462FCBD4C; Sat, 26 Jan 2002 14:36:41 -0800 (PST) Received: from localhost.localdomain ([206.124.139.115]) by thig.blarg.net (8.9.3/8.9.3) with ESMTP id OAA12990; Sat, 26 Jan 2002 14:36:40 -0800 Received: (from jojo@localhost) by localhost.localdomain (8.11.6/8.11.3) id g0QMdnf06829; Sat, 26 Jan 2002 14:39:49 -0800 (PST) (envelope-from swear@blarg.net) To: "Bob Giesen" Cc: "freebsd-questions" Subject: Re: shells confusion References: <20020126020430.P175-100000@BLAST> <004301c1a684$0de9bb00$ab41d03f@pegasus> From: swear@blarg.net (Gary W. Swearingen) Date: 26 Jan 2002 14:39:49 -0800 In-Reply-To: <004301c1a684$0de9bb00$ab41d03f@pegasus> Message-ID: Lines: 40 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Bob Giesen" writes: > [...] However, should you learn one of those whiz-bang > shells, first, you may find dealing with Bourne-shell scripts a bit more > frustrating when you find that you have to take into account its > limitations. Our newbie should also know that "Bourne shell" has no one definition. I'm not sure of the history of the term, but I seem to remember that Mr. Bourne wrote the first one about 25 years ago and at some point AT&T choose it for most of their scripts and developed the official version until I don't know when. (They later switched to KSH, IIRC.) The various non-BSD Unixes (and later the BSDs) all developed their own "sh" programs that had many features in common with the AT&T version and some differences. Eventually (1992?), POSIX came up with a sort of minimal definition which allowed variants. Probably all shells today attempt to follow to a high degree, usually with a POSIX flag which tries harder to follow the rules, but which few use. I suspect that widely-compatible "sh" scripts these days go beyond both old "sh" scripts and POSIX, but I don't know for sure. It shouldn't be hard to find more reliable history with a WWW searcher. But FreeBSD's "sh" (or any other, I suppose) has many features that go beyond old-fashioned Bourne shell and POSIX. I have no reason to believe that the FreeBSD "sh" is anymore compatible with most other systems's "sh" scripts than "ksh", "bash", or true Unix "sh" variants (with or without POSIX flags set), except that the FreeBSD "sh" man page doesn't discuss POSIX issues much (but that might be just a documentation issue.) It does have many FEWER advanced features, though, so I do agree with the above quote. Finally, I know that some people choose to support non-GPL software when it's not a great sacrifice, which rules out "bash" for some. After dropping GNU/Linux, I choose "pdksh" so I could later easily carry it's peculiarities with me between OSes instead of learning those of FreeBSD's "sh" (though maybe it's as portable as "pdksh"). It works well interactively and seems to well-support the writing of broadly- compatible "sh" scripts (when you don't use the documented ksh-only stuff that you reserve for the command line). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message