for dir in $(cat dirs.txt); do ( cd "$dir"; echo "Hello from $(pwd)" ); done for dir in $(cat dirs.txt); do ( cd "$dir"; echo "Hello from $(pwd)" ); doneFundamentally, bash is just... verbose.
I.e.: Here's the same task implemented in two scripting languages:
PowerShell is 5 lines of code: https://learn.microsoft.com/en-us/azure/virtual-machines/ena...
Bash is several pages: https://learn.microsoft.com/en-us/azure/virtual-machines/ena...