[HN Gopher] The Shell Hater's Handbook (2010)
       ___________________________________________________________________
        
       The Shell Hater's Handbook (2010)
        
       Author : samlambert
       Score  : 53 points
       Date   : 2024-11-01 17:22 UTC (5 hours ago)
        
 (HTM) web link (shellhaters.org)
 (TXT) w3m dump (shellhaters.org)
        
       | genezeta wrote:
       | (2010)
       | 
       | Sadly the video seems to be missing; the whole GoGaRuCo
       | conference site is gone, actually.
       | 
       | Maybe it makes more sense to post the link to YT, as you did in
       | 2022 https://news.ycombinator.com/item?id=32521080
        
         | sundarurfriend wrote:
         | I tried following the slide deck (to get an idea of the
         | content), but that's pretty rough too. The page reloads itself
         | constantly and is very inconsistent with responding to input
         | keys, it's not a pleasant experience.
         | 
         | Thanks for the (indirect) link to the YouTube video, will give
         | that a try.
        
         | sundarurfriend wrote:
         | > Maybe it makes more sense to post the link to YT, as you did
         | in 2022
         | 
         | Based on the comments there, it seems like OP posted this
         | current (shellhaters.org) link then too, and it's the mods that
         | replaced it to point to the YouTube video. Hopefully the same
         | will happen this time around as well.
        
       | Eisenstein wrote:
       | Getting a DNS error from confreaks.
       | 
       | You can get the video here:
       | 
       | * https://web.archive.org/web/20140207100122/http://confreaks....
        
       | packetlost wrote:
       | YouTube link for video if it's broken for others and not just me:
       | 
       | https://www.youtube.com/watch?v=olH-9b3VJfs
       | 
       | Something I learned recently is that the Bourne shell (and by
       | extension, bash and POSIX's sh) have syntax inspired by Algol 68
       | (source [0]), which explains some of the funkyness. One thing
       | I've been doing recently is writing scripts in rc, the default
       | shell for plan9. It's a bit saner syntax-wise IMO. Versions
       | linked against readline have file-based completion, but it's
       | otherwise not quite robust enough for me to switch away from fish
       | as my default, but it has some things I prefer over both bash and
       | fish.
       | 
       | I encourage people to give rc and awk a shot, they're both small
       | and learnable in an afternoon!
       | 
       | [0]: https://doc.cat-v.org/plan_9/4th_edition/papers/rc
        
         | Rendello wrote:
         | The Bourne shell was hilariously written in horribly deformed C
         | resembling ALGOL by way of macros:
         | 
         | https://www.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh...
         | 
         | https://news.ycombinator.com/item?id=22191790
        
           | packetlost wrote:
           | That's amazing
        
       | yanowitz wrote:
       | And its inspiration is still great but could use a refresh:
       | https://web.mit.edu/~simsong/www/ugh.pdf
        
         | alkh wrote:
         | Thanks for reminding me about this gem! :)
        
       | hamandcheese wrote:
       | I've grown rather fond of bash in my current role. I work mainly
       | on developer tools and CI pipelines, both of which mean gluing
       | together lots of different CLI tools. When it comes to this kind
       | of work I think it is quite hard to beat the expressiveness of
       | shell scripting. I say this as a former hater of bash and its
       | syntax.
       | 
       | Much credit to copilot and shellcheck, which have made complex
       | bash ever the more write-only language than it already was.
        
         | chasil wrote:
         | Bash actually has more warts than competing shells because of
         | its historic stance.
         | 
         | My bugbear is that "alias p=printf" works well in any POSIX
         | shell script, including bash when it is invoked as #!/bin/sh -
         | but when called as #!/bin/bash, the alias (used in a script)
         | fails with an error.
         | 
         | While the Korn shell managed to evolve and comply with the
         | POSIX standard, bash decided to split the personality, so one
         | solution to the above alias failure is to toggle POSIX mode.
         | 
         | Bash was forced to do this, to keep a decade of shell scrips
         | that were written for it working. Pity.
         | 
         | The standard for the POSIX shell looked very hard at Korn, and
         | credits it. Bash is not mentioned.
        
           | mort96 wrote:
           | Huh, why wouldn't that alias work?
        
             | photon-torpedo wrote:
             | Good question. Something to do with interactive mode?
             | $ cat l.sh       alias l=ls       l       $ sh l.sh
             | file1  file2  l.sh       $ bash l.sh       l.sh: line 2: l:
             | command not found       $ bash -i l.sh       file1  file2
             | l.sh
             | 
             | Edit: Ah yes, the man page says so.
             | 
             | > Aliases are not expanded when the shell is not
             | interactive, unless the expand_aliases shell option is set
             | using shopt
        
               | mort96 wrote:
               | Thanks, I had no idea. I guess I've never used aliases in
               | scripts, but I would've assumed that they'd just work the
               | same as in interactive mode. Good to know.
        
       | nlawalker wrote:
       | I'm not familiar with the landscape - is there a "compiles to
       | reasonably-readable [ba]sh" language that's gotten any traction
       | anywhere? That seems like at least an interesting possible
       | solution.
        
         | chamomeal wrote:
         | There was a pretty great-looking one that I saw on HN in the
         | last few months. I didn't end up trying it, and I don't
         | remember what it was called.
         | 
         | There's also babashka, which pretty much let's you write
         | clojure in your shell scripts.
        
           | bewuethr wrote:
           | Was it https://amber-lang.com?
        
           | dmckeon wrote:
           | Might have been Oil shell, which is worth looking at:
           | https://www.oilshell.org/
        
       | dxdxdt wrote:
       | Sorry, really don't have time to sit on my arse and watch a video
        
       ___________________________________________________________________
       (page generated 2024-11-01 23:00 UTC)