LWN: Comments on "Go fish! (developerWorks)" https://lwn.net/Articles/309461/ This is a special feed containing comments posted to the individual LWN article titled "Go fish! (developerWorks)". en-us Wed, 22 Oct 2025 13:40:14 +0000 Wed, 22 Oct 2025 13:40:14 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Some bash enhancements... https://lwn.net/Articles/310138/ https://lwn.net/Articles/310138/ Richard_J_Neill <div class="FormattedComment"> It would be nice to see a few changes in bash for version 4. I'd like to see at least the following:<br> - syntax highlighting at the bash prompt (not just in editors). This idea is one we should take from fish.<br> - some sensible string functions with aliases defined so that we can use more familiar constructs eg strlen, rather than ${#string}<br> - trim() or chomp().<br> - more array functions, eg array_keys(), and multi-dimensional arrays<br> - a builtin to do path canonicalisation (like /usr/bin/readlink)<br> - a way to get variables back from subshells (the converse of EXPORT)[1]<br> - some hybrid of nullglob and failglob so that a mismatched glob results in null. [2]<br> <p> I still do a *lot* of programming in bash, and it's pretty good. Just not perfect.<br> <p> <p> [1] Yes, I know this is really an OS feature. But still, why shouldn't a parent be allowed to explicitly access variables set in a subshell? This wouldn't be such a problem, except that subshells can only return a 1-byte integer exit value; rather than an array or a string. <br> <p> [2] This needs some more explanation - here is an example: <br> mkdir test<br> cd test<br> touch a b c d<br> <p> ls *z<br> ls: cannot access *z: No such file or directory<br> #Normally, bash will fail to expand the *z, and will then pass it to <br> #ls as a literal '*z'. <br> <p> shopt -s nullglob<br> ls *z<br> a b c d<br> #Bash now treats '*z' as empty, and runs ls with no parameters.<br> <p> shopt -s failglob<br> ls *z<br> bash: no match: *z<br> #Here, we get no match, but we get an error instead.<br> <p> What I want is for "ls *z" to be like listing an empty directory. i.e. bash gives ls an explicit argument of NUL. <br> <p> </div> Mon, 08 Dec 2008 13:53:53 +0000 Go fish! (developerWorks) https://lwn.net/Articles/310014/ https://lwn.net/Articles/310014/ dmag <div class="FormattedComment"> That's exactly why fish is neat. The existing shells are ONLY used because they are ubiquitous. Nobody says "bash is an awesome programming language." <br> <p> If you use Fish as your shell, then you can also use it to write Fish shell scripts. The "language" around the shell is a lot less arcane and has more conceptual integrity.<br> <p> That said, I've tried to use fish as my main shell, and failed because it takes a while to learn. I couldn't figure out how to do "(sleep 1h; xmessage time to go) &amp;".<br> <p> </div> Sat, 06 Dec 2008 16:02:44 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309853/ https://lwn.net/Articles/309853/ njs <div class="FormattedComment"> Very slick indeed, thanks for sharing!<br> </div> Fri, 05 Dec 2008 09:42:22 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309834/ https://lwn.net/Articles/309834/ sitaram <div class="FormattedComment"> thanks!<br> <p> I'm a perl guy normally, but I wrote this to show (show off?) a bunch of perl/python/java type kids what plain bash could do...<br> </div> Fri, 05 Dec 2008 03:11:47 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309812/ https://lwn.net/Articles/309812/ nix <div class="FormattedComment"> Oh, that's very neat. I can think of half a dozen times I've done things <br> in deeply ugly ways that could have been done like that.<br> <p> The code's not even contorted to fit: the 'one line at the end where <br> control sits forever' just falls out of it.<br> <p> </div> Fri, 05 Dec 2008 00:41:39 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309682/ https://lwn.net/Articles/309682/ sitaram <div class="FormattedComment"> I'll admit exception handling is a little over the top for a shell, but bash has a few tricks up its sleeve too.<br> <p> What would you say to a job-queuing program whose main "loop" is essentially the single statement "wait", and which did everything else by trapping SIGCHLD? Take a look at <a href="http://sitaramc.googlepages.com/queue.sh">http://sitaramc.googlepages.com/queue.sh</a> (but note: I wrote it for a lark and it seemed to work fine in testing but I never actually used it "in production")<br> </div> Thu, 04 Dec 2008 16:49:26 +0000 not really a name conflict https://lwn.net/Articles/309623/ https://lwn.net/Articles/309623/ jengelh <div class="FormattedComment"> I seem to remember Midnight Commander once upon a time built upon a fish binary to establish its "Shell link" feature.<br> </div> Thu, 04 Dec 2008 11:41:59 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309539/ https://lwn.net/Articles/309539/ JoeBuck "Stagnation" just means that 10-year-old code still runs. Better to write a new scripting language than to incompatibly change an old one. Wed, 03 Dec 2008 23:52:19 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309538/ https://lwn.net/Articles/309538/ nix <div class="FormattedComment"> zsh certainly isn't stagnant either. It doesn't roar along with huge <br> numbers of new features, but it already has so *many* that if it adds many <br> more the manual will collapse into a black hole.<br> <p> (Recentish features include UTF-8 support, which now seems to have enough <br> of the bugs worked out of it to be useful, and exception handling, which <br> in any shell but zsh would have me spluttering in amazement. This being <br> zsh, though, it's not surprising: I fully expect I've just overlooked the <br> strong AI that can write your code for you, if you can figure out the <br> incredibly baroque syntax for telling it what to do.)<br> <p> </div> Wed, 03 Dec 2008 23:48:00 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309532/ https://lwn.net/Articles/309532/ drag <div class="FormattedComment"> I don't see mature and useful software as stagnating. Instead it just gets incorporated into larger and more complex hunks of software.<br> <p> It's nice to see some change going on though. <br> </div> Wed, 03 Dec 2008 23:16:42 +0000 not really a name conflict https://lwn.net/Articles/309526/ https://lwn.net/Articles/309526/ JoeBuck ... since fish in the context of FTP over SSH is not typed as a command, rather it is used in URLs, always followed by a colon. Wed, 03 Dec 2008 22:57:14 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309516/ https://lwn.net/Articles/309516/ tyhik <div class="FormattedComment"> <font class="QuotedText">&gt; Unix shells have stagnated in recent years.</font><br> <p> Like much of that basic unix and internet stuff. The rfc793 dates back to almost thirty years<br> </div> Wed, 03 Dec 2008 22:24:47 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309509/ https://lwn.net/Articles/309509/ tzafrir On a zsh: <pre> % gpg --l[tab][tab] --list-keys -- list all keys --list-options -- modify what the various --list-* --list-packets -- list only the sequence of packets --list-public-keys -- list all public keys --list-secret-keys -- list all secret keys --list-sigs -- lists keys and signatures --local-user -- use name as the user ID to sign --lsign-key -- sign a key but mark as non-export --list-only --lock-never --logger-fd --lock-multiple --lock-once </pre> Wed, 03 Dec 2008 21:42:46 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309501/ https://lwn.net/Articles/309501/ emk <div class="FormattedComment"> Overall, it looks rather nice. There are two things which I would definitely miss, though:<br> <p> 1) "Here documents". <br> 2) The "VAR=value" notation. I've never really loved "set VAR value", personally.<br> <p> But all in all, it's a good idea. Unix shells have stagnated in recent years.<br> </div> Wed, 03 Dec 2008 21:02:26 +0000 Go fish! (developerWorks) https://lwn.net/Articles/309468/ https://lwn.net/Articles/309468/ jengelh <div class="FormattedComment"> Hooray again for name conflicts — file over ssh (fish) greets.<br> </div> Wed, 03 Dec 2008 19:09:57 +0000