Re:Bashing the Bash – Replacing Shell Scripts with Python (2...
by 1vuio0pswjnm7 on Saturday March 26, 2022 @03:49AM
(#30810063)
Personally, I never use bash for scripting. I use the system's scripting shell, Debian's Dash or NetBSD Ash. Rhetorical question: If Bash was great for shell scripting, why doesn't the OS project choose it for scripting. When I compile the OS kernel and userland, the project (NetBSD) uses shell scripts not Python. Not suggesting the shell is necessarily better but I am suggesting it works and people understand it.
There are many ways to run a command on every .yaml file in a directory. Personally I like using xtrace. Something like:
echo cd the_directory > 1.sh
echo "test -f *.yaml" >> 1.sh
ls -1 *.yaml|sed 's/^/the_tool /' >> 1.sh
chmod +x 1.sh
less 1.sh
sh -ex 1.sh
As mostly a day-to-day shell user who automates some things, I do not use Python. Never had an outage.
There are many ways to run a command on every .yaml file in a directory. Personally I like using xtrace. Something like:
As mostly a day-to-day shell user who automates some things, I do not use Python. Never had an outage.