3 ms·
> I'm pretty comfortable with posix shell. It's ok to trust yourself. Write 1 file shell scripts for convenient zero dependency command line tools that will w
by nickjj 4y ago
> I'm pretty comfortable with posix shell.
It's ok to trust yourself.
Write 1 file shell scripts for convenient zero dependency command line tools that will work on most systems. If things start to get rough due to shell limitations, then Python scripts without dependencies is another 1 file solution that's quite portable. You can even mix and match (mostly use shell and call Python from it for the complicated bits as a last resort).
I wrote about this exact topic recently around trying to deal with string splitting in Bash: https://nickjanetakis.com/blog/splitting-strings-by-a-delimiter-with-ifs-and-bash-string-replace https://nickjanetakis.com/blog/splitting-strings-by-a-delimi...
The takeaway is that for 99% of cases using IFS or Bash's string replace in a variable is great but if you have strict parsing requirements then maybe going with Python is worth it. The post links to a massive SO answer that demonstrates how string manipulation in shell scripting is hard.