Confusingly, moreutils parallel is not "GNU parallel". Moreutils parallel is very simple, while the other parallel is very featureful. Linux distributions can deal with the conflict, but bad package managers like homebrew cannot.
"rename" shares the same fate, there are several implantations, completely different from each other
seq is “less known”? I’d assume anyone familiar with shell scripting would know about it.
It’s a great starting point for entertaining children on a terminal:
seq 99 -1 0 | xargs printf ‘%s bottles of beer on the wall…\n’Bash kinda broke seq for me since you can just write {99..0}
Or if you need dynamic arguments, you probably want:
N=9; for ((i=0; i<=N; ++i)); do echo "$i"; done
Re:The Hidden Gems of Moreutils
by andrewshadura on Saturday December 30, 2023 @01:44PM
(#38817658)
Why use this form of for when you can just use seq and it works in any shell including fish?
Because capturing the output of `seq` requires spawning a whole separate process (significant for small sequences) and shoving all the data into a single buffer (significant for large sequences) rather than working incrementally.
Re:The Hidden Gems of Moreutils
by bloopernova on Saturday December 30, 2023 @10:53AM
(#38816146)
Less known maybe for most people who read HN, but you're right that a lot of shell scripting folks would know about it.
Similarly, there's some lesser-known useful stuff in GNU Coreutils:
https://en.wikipedia.org/wiki/List_of_GNU_Core_Utilities_com...