LWN: Comments on "Bash 3.0 released" https://lwn.net/Articles/96648/ This is a special feed containing comments posted to the individual LWN article titled "Bash 3.0 released". en-us Mon, 22 Sep 2025 17:23:03 +0000 Mon, 22 Sep 2025 17:23:03 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Bash 3.0 released https://lwn.net/Articles/97678/ https://lwn.net/Articles/97678/ Wills <font class="QuotedText">&gt; Another new feature of interest is the addition of history</font><br> <font class="QuotedText">&gt; timestamps. This allows users to see when commands were run,</font><br> <font class="QuotedText">&gt; which can provide some useful and interesting information.</font><br> <p> Without implying any sort of criticism of bash, I would like to note that history timestamps have been in (t)csh for c.15 years and arrays, which bash didn't have until bash 2.0 in 1997, for c.10 years. <br> Thu, 12 Aug 2004 17:49:18 +0000 Bash programming enhancements - worthwhile! https://lwn.net/Articles/97272/ https://lwn.net/Articles/97272/ mwilck <p>The shell is superior to all of these if a program <ul> <li>doesn't handle complex data structures</li> <li>carries out many file system activities like searching and moving files or manipulating text files</li> <li>makes much use of command line programs e.g. from the Unix tool box</li> </ul> Maybe some time in the future all text files will be XML and the file system will be replaced by a CORBA interface to some data base. I hope that happens after I retire. </p> <p>P.S. did you really mean <em>Java</em> ? Ever seen a shell that needs a 30MB VM to be loaded before it can print "hello world!" ?</p> <p>Martin, not looking forward to object-oriented bash programming but still seeing room for enhancements.</p> Tue, 10 Aug 2004 14:44:33 +0000 Bash programming enhancements - worthwhile? https://lwn.net/Articles/97063/ https://lwn.net/Articles/97063/ nix Some of us like bash as a programming language too.<br> <p> (comments below apply to python as well, I think).<br> <p> You can't use perl in many environments, either because it isn't available, or because you're not allowed to replace an ancient and buggy module; perl has a hugely higher startup overhead than bash does; you can't sanely use perl scripts at system startup time; one-liners at the shell prompt tend to grow into scripts, and (at least for me) those one-liners are, well, bash scripting...<br> <p> Yes, there is a reason to improve bash as a programming language. :)<br> Sat, 07 Aug 2004 14:50:04 +0000 Bash programming enhancements - worthwhile? https://lwn.net/Articles/96912/ https://lwn.net/Articles/96912/ giraffedata If people have time to enhance Bash as a programming language, I'd sure rather they spend that time enhancing one of the languages that are already way ahead of Bash (Perl, Python, Java, whatever). Couldn't we let Bourne Shell (as a programming language) take its place in history? <p> On the other hand, I'll never get tired of new inventions in Bash as a command shell. Fri, 06 Aug 2004 01:25:57 +0000 Associative Arrays Still in the Future? Yuck! https://lwn.net/Articles/96905/ https://lwn.net/Articles/96905/ AnswerGuy <p> Korn shell has had support for associative arrays (which python calls "dictionaries," and perl "hashes") for eons (well over a decade I think). </p><p> I'll also be interested in whether bash 3.x fixes one shortcoming of bash that's been around forever. Consider the following: </p><p> <blockquote><tt>unset foo; echo bar | read foo; echo $foo</tt></blockquote> </p><p> What should the output be? </p><p> In zsh and ksh you'll see that foo is set; they spawn the subshells to the left of the pipe. In bash you'll find it unset because the read occurs in a subshell which exits at the semicolon. (Thus necessitating braces or parents to group the part after the pipe; or force them all into yet another, explicit subshell). </p><p> To most shell scripters this is obscure; nobody cares. However, for serious shell scripting this sort of thing is important (not so much for reading values from subprocesses into single variables, but for reading multiple variables parsed on $IFS, for example). </p><p> (Yes, I know, most UNIX/Linux admins and programmers would counter that serious scripting isn't done in shell --- that "real programmers" (and scripters) use Perl. To which I can only respond: <b>"Foo!"</b></p> <blockquote>JimD</blockquote> Fri, 06 Aug 2004 00:04:44 +0000 Some distribs (Gentoo) have it out already, at least in unstable. https://lwn.net/Articles/96834/ https://lwn.net/Articles/96834/ Duncan <font class="QuotedText">&gt; Interested users who don't want to wait for Bash </font><br> <font class="QuotedText">&gt; to ship with their favorite distribution [...] </font><br> <br> Of course, other interested users already HAVE it shipping in their <br> favorite distribution, and have been using it for several days, if they <br> are running unstable, anyway. <br> <br> Gentoo, anyone? A FreeBSD user on my ISP reported it was out for them as <br> well, altho that's obviously not a /Linux/ "distribution". <br> <br> One bug confirmed both on Gentoo and FBSD, so it's apparently upstream, so <br> far: Where history scrollback (using the arrow keys, for instance) used <br> to let you go back in your command list, and then return to the normally <br> blank initial command, with 3.0, if one scrolls back at least two <br> commands, one can only scroll back forward to the last /history/ command, <br> the one BEFORE the previously blank command. To get back to the blank <br> command, one must use ^C. (If one scrolls only one command up, one can <br> still scroll that single command back down. It only breaks if one scrolls <br> at least two commands up.) <br> <br> Or maybe that's a POSIX compliance thing? Do they standardize even <br> history scrolling to /that/ extent? <br> <br> Duncan <br> Thu, 05 Aug 2004 17:49:47 +0000 FYI: incompatibility in 'trap' https://lwn.net/Articles/96808/ https://lwn.net/Articles/96808/ vmole <p>It turns out that one of the POSIX fixes breaks a long standing use of the 'trap' builtin. Previously, one could specify e.g. <pre> trap 0 </pre> to reset the signal handler to the default for signal 0. POSIX requires the form <pre> trap - 0 </pre> Turning POSIX mode off, or running the script with "#!/bin/bash" instead of "#!/bin/sh" solves this, but doesn't really help scripts that are meant to be portable. <p>(No, I didn't figure this out myself. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=261948 for details.) Thu, 05 Aug 2004 15:22:59 +0000 regexps vs regexps https://lwn.net/Articles/96787/ https://lwn.net/Articles/96787/ rfunk <blockquote><i>Regular expressions are first of all a theoretical concept</i></blockquote> <p>Yes, I tried to account for that without getting into the theoretical details that I don't remember. <blockquote><i>If we start nit picking, we should not mistake one of those syntaxes as the one and only real regular expression syntax.</i></blockquote> Except that globs do not have the power required by a true (theoretical) regular expression. They can't express everything that a regular expression can. Thu, 05 Aug 2004 14:26:06 +0000 globs vs regexps https://lwn.net/Articles/96764/ https://lwn.net/Articles/96764/ Lasse99 Ooops! That should have been '^[^./][^/]*$' <br> Thu, 05 Aug 2004 11:35:55 +0000 globs vs regexps https://lwn.net/Articles/96763/ https://lwn.net/Articles/96763/ Lasse99 Actually, the single-star glob '*' is equivalent to the rather complicated <br> regular expression '^[^.].*$' or even '^[^./][^/]$'. <br> On the other hand, the simple regular expression '.*' must be expressed by <br> a set of two filename globs, namely ( '.*' '*' ). <br> So, it is debatable which syntax is more complicated... <br> Thu, 05 Aug 2004 11:34:05 +0000 regexps vs regexps https://lwn.net/Articles/96707/ https://lwn.net/Articles/96707/ pkolloch <p>Regular expressions are first of all a theoretical concept. In that sense, regular expressions specify a (often infinite) language of accepted words. Fileglobs are usually not quite as powerful, but have a simplified syntax. There are some very frequently used regular expressions syntaxes as nicely described in the referenced WikiPedia page.</p> <p>If we start nit picking, we should not mistake one of those syntaxes as the one and only real regular expression syntax.</p> Thu, 05 Aug 2004 08:22:28 +0000 RE: globs vs regexps https://lwn.net/Articles/96693/ https://lwn.net/Articles/96693/ stuart_hc Yes, this is an important point to stress. Filename pattern matching was historically related to regular expressions but the two have always been distinct. Filename patterns are described under the <a href="http://www.gnu.org/software/bash/manual/bashref.html#SEC35">Pattern Matching</a> section of the Bash man page, or better still in the POSIX standard on <a href="http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13"> Pattern Matching Notation</a>. The Wikipedia page on <a href="http://en.wikipedia.org/wiki/Regular_expression">Regular Expressions</a> gives both a gentle introduction and a formal description. Thu, 05 Aug 2004 06:42:34 +0000 globs vs regexps https://lwn.net/Articles/96687/ https://lwn.net/Articles/96687/ rfunk <blockquote><i>The "failglob" option will probably be of interest to many users. When set, this option will cause an error when a regular expression fails to match any files</i></blockquote> <p> Filename globs are not regular expressions. <p> Filename globs are those expressions where ? matches a single character, * matches any number of characters, and the beginning and end are always anchored (e.g. a*d matches abcd but not qabcdz). <p> Regular expressions have a precise meaning I don't remember at the moment, but commonly refer to expressions where a period matches a single character, a * <i>modifies</i> a previous bit of the expression to match any number of that bit, and beginning and end achors must be explicitly specified if they are desired. (a.*d matches both abcd and qabcdz.) <p> The single-star glob "*" is equivalent to the four-character regular expression "^.*$". <p> Confusion between these two systems trips up a lot of people, so it's important not to refer to one when you mean the other. Thu, 05 Aug 2004 05:31:34 +0000