Would you believe me if I told you that I've never, ever, used getopts or paralllel ? ๐ I Never had the need to ... I found better alternatives that were easier to "memorize".
getopts - See bargs; A framework for creating a Bash CLI. You would expect me to use getops for the "Usage" menu ... But I haven't, I used other tricks to make it work
parallel - I've never processed big files in Bash, if I need to go down this road, I'll probably use Go, where it's more inclined towards parallelism and threading. I do use background jobs, but mainly for short processes which don't require "blocks of data". Instead, I use background jobs, which is simply adding & to a command and wait in the bottom of the file to wait for it to finish. For example "downloading 5 files in parallel" or "encrypting 10 files in parallel".
curl -o file1 https://example.com/file1 &
curl -o file2 https://example.com/file2 &
curl -o file3 https://example.com/file3 &
curl -o file4 https://example.com/file4 &
curl -o file5 https://example.com/file5 &
wait# for all jobs to finish ...
It's also a matter of time/knowledge; if you know getopts and parallel then use them. If you don't, feel free to pass it, as I haven't found it "mandatory", but that's me.
Also, off the top of my mind: getopt for flags and parallel to avoid writing loops in scripts (Iโm just being creative)
Would you believe me if I told you that I've never, ever, used
getoptsorparalllel? ๐ I Never had the need to ... I found better alternatives that were easier to "memorize".getopts - See bargs; A framework for creating a Bash CLI. You would expect me to use
getopsfor the "Usage" menu ... But I haven't, I used other tricks to make it workparallel - I've never processed big files in Bash, if I need to go down this road, I'll probably use Go, where it's more inclined towards parallelism and threading. I do use
background jobs, but mainly for short processes which don't require "blocks of data". Instead, I usebackground jobs, which is simply adding&to a command andwaitin the bottom of the file to wait for it to finish. For example "downloading 5 files in parallel" or "encrypting 10 files in parallel".It's also a matter of time/knowledge; if you know
getoptsandparallelthen use them. If you don't, feel free to pass it, as I haven't found it "mandatory", but that's me.I didnโt know about bargs! Thatโs precious advice, thank you!