News for hackers. Stuff that matters.
Re:Fast Markov chains in ~20 lines of sh, grep, cut and Awk by mkoryak on Saturday November 09, 2019 @07:05PM (#21495426)
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.

Re:Fast Markov chains in ~20 lines of sh, grep, cut and Awk by m31415 on Saturday November 09, 2019 @07:19PM (#21495502)
Not 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.
Re:Fast Markov chains in ~20 lines of sh, grep, cut and Awk by AlEinstein on Saturday November 09, 2019 @08:36PM (#21495816)
Which makes it a valid reference for bash.
Re:Fast Markov chains in ~20 lines of sh, grep, cut and Awk by m31415 on Saturday November 09, 2019 @09:27PM (#21496022)
That'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

Re:Fast Markov chains in ~20 lines of sh, grep, cut and Awk by craftinator on Monday November 11, 2019 @08:34AM (#21504683)
Not being pedantic, but * something pedantic *.
Re:Fast Markov chains in ~20 lines of sh, grep, cut and Awk by m31415 on Tuesday November 12, 2019 @11:26PM (#21521168)
What I meant is that I'm not being pedantic for the sake of being pedantic.