Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.os.linux.development.system Subject: Re: UNIX(*)/ Linux history & system design Date: Wed, 07 May 2014 16:23:45 +0100 Lines: 46 Message-ID: <87a9atpq7y.fsf@sable.mobileactivedefense.com> References: <87k3adxomn.fsf@sable.mobileactivedefense.com> <87wqear01o.fsf@sable.mobileactivedefense.com> <874n1dwvo0.fsf@sable.mobileactivedefense.com> <87zjj5vf1k.fsf@sable.mobileactivedefense.com> <87k3a0q867.fsf@sable.mobileactivedefense.com> <87zjivatio.fsf@sable.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net RTj1lZBYup/9y5UgoN9bDw+nEJmhYYxDF2adTBT+xkvmQcchw= Cancel-Lock: sha1:ePO0HnO/6ByWkUV33hqOf8P6Ewg= sha1:ifedibOSoNSVpMnilmn+y96C1JM= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Xref: csiph.com comp.os.linux.development.system:690 crankypuss writes: > On 05/06/2014 08:09 AM, Rainer Weikusat wrote: [...] > I don't know anything about Perl scripts, never having written one. > If I remember correctly, I wrote "exactly" one bash script when I > first began using linux. Enough to get the flavor of it. Enough to > recognize it as the distant relative of some ancient scripting tools > that I'd used elsewhere; quite enough for my taste, thank you. [...] > Yesterday I was pondering the crudeness of bash and wondering why it > has not entirely atrophied, and realized what I think is the reason > for its continued existence: make. So it goes, the more deeply > entrenched something is, the more effort is required to expunge it > from the realm of the necessary and banish it into the realm of the > optional. 'bash' is an extended implementaton of the Bourne shell language which is 'in the realm of the necessary' simply because it's an international standard. In addition to constructs specific to its purpose, ie invoking programs, possibly, programs cooperating in a pipeline, it supports the usual syntactic constructs available in 'pre-OO' high-level languages: Three kinds of loop ('loop while a condition is true', 'loop until a condition becomes false', 'loop over the elements of a list'), loop control statements ('break' and 'continue'), conditionals (if .. elif ... elif ... else, a 'case statement' and the possibility to create named subroutines (but not lexically-scoped variables, although bash has them as an extension). It doesn't use braces as universal block delimiter but keywords depending on the 'block construct' being used. For loops, thats do .... done, for if then ... fi and for case, it is case ... esac. The latter two pairs are Algol-68 influenced, presumably, because Steve Bournce (author of the original Bourne shell) was very fond of that. It doesn't support named parameters for functions (or scripts), only positional ones. While I wouldn't to use it (in case suitable alternatives are available) for something larger than at most a few hundred lines of code[*], it is a perfectly usable programming language and often, a very easy to use one. Would you care to elaborate why precisely you consider it to be 'so crude that it is astonishing it didn't vanish'? [*] OTOH, a lot of things can be built by using the shell to combine other programs, some or all of them being shell scripts, too.