Comment by simoncion

9 hours ago

Yeah, seriously. It's as if people want to playact as illiterate programmers.

The "Redirections" section of the manual [0] is just seven US Letter pages. This guy's cheat sheet [1] that took me ten seconds to find is a single printed page.

[0] <https://www.gnu.org/software/bash/manual/html_node/Redirecti...>

[1] <https://catonmat.net/ftp/bash-redirections-cheat-sheet.pdf>

> The "Redirections" section of the manual [0] is just seven US Letter pages.

"Just" seven US Letter pages? You're talking about redirections alone, right? How many such features exist in Bash? I find Python, Perl and even Lisps easier to understand. Some of those languages wouldn't have been even conceived if shell languages were good enough.

There is another shell language called 'execline' (to be precise, it's a replacement for a shell). The redirections in its commands are done using a program named 'fdmove' [1]. It doesn't leave any confusion as to what it's actually doing. fdmove doesn't mention the fact that it resorts to FD inheritance to achieve this. However, the entire 'shell' is based on chain loading of programs (fork, exec, FD inheritance, environment inheritance, etc). So fdmove's behavior doesn't really create any confusion to begin with. Despite execline needing some clever thinking from the coder, I find it easier to understand what it's actually doing, compared to bash. This is where bash and other POSIX shell languages went wrong with abstractions. They got carried away with them.

[1] https://www.skarnet.org/software/execline/fdmove.html

  • > "Just" seven US Letter pages?

    Yes. It's the syntax alongside prose explaining the behavior in detail. Go give it a read.

    If you want documentation that's done up in the "modern" style, then you'll prefer that one-page cheat sheet that that guy made. I find that "modern" documentation tends to leave it up to each reader to discover the non-obvious parts of the behavior for themselves.

    > I find Python ... easier to understand.

    Have you read the [0] docs for Python's 'subprocess' library? The [1] docs for Python's 'multiprocess' library? Or many of the other libraries in the Python standard library that deal with nontrivial process and I/O management? Unless you want to underdocument and leave important parts of the behavior for users to incorrectly guess, such documentation is going to be much larger than a cheat sheet would be.

    [0] ...twenty-five pages of...

    [1] ...fifty-nine pages of...