Bash has a horrible syntax. Beyond a simple for loop I would reach for Perl.
Re:Perl 11
by MichaelMoser123 on Wednesday October 24, 2018 @09:50AM
(#18292385)
But it has set -x ; really helps to see what the script is doing step by step. I don't know how to do that easily with other languages.
Put "how to trace a X script" (where X is a language name) into the search engine of your choice.
Shell scripts have so many footguns. Python is almost as terse, takes less time to write (for me anyway), and is way more maintainable.
What Linux distros don't include Perl by default? I certainly haven't come across any...
Re:Perl 11
by MichaelMoser123 on Wednesday October 24, 2018 @10:26AM
(#18292659)
Well I did not do a lot of research for this post, but many installations that I have to deal with come from some image where perl is not been installed.
On the other hand bash has maps so it is possible to use that more for scripting.