3 ms·
This is awesome because it is a real shell script that does something interesting AND it's well documented. I'm bookmarking this as a bash script reference.
by mkoryak 7y ago
This is awesome because it is a real shell script that does something interesting AND it's well documented.
I'm bookmarking this as a bash script reference.
- m31415 7y agoNot being pedantic, but OP's script isn't Bash, it's POSIX sh. POSIX sh can be executed in Bash, but there are several differences. The only non-POSIX command I can spot in that script is shuf.
- AlEinstein 7y agoWhich makes it a valid reference for bash.
- m31415 7y agoThat's like saying a well-written C program is a good reference for C++. In any case, writing POSIX-only shell scripts is much harder than writing Bash scripts, which can often be much faster (e.g., one can use {1..10}, which doesn't need an external call, instead of `seq 1 10` to iterate through a list of numbers). For POSIX-only shell scripts, the ones used in Git [1] are some of the best-written I've seen. [1]: https://github.com/git/git/search?l=shell https://github.com/git/git/search?l=shell
- deleted 7y ago[deleted]
- craftinator 7y agoNot being pedantic, but * something pedantic *.
- m31415 7y agoWhat I meant is that I'm not being pedantic for the sake of being pedantic.