I have a bash script that should be executing a number of commands. The commands work fine when entered in a termainal but when I try to execute them from inside the script they don't work, so I assume it's something environment-specific.
In the script I have
and it doesn't work, while if I copy the contents of $cmd and paste in a terminal it works fine.
How do I keep the current environment when running the script? Or do you have any other idea what it might be?