I am running a quite complicated script which changes directories and runs many other commands. All these commands are run using 'scriptname', which works fine when I execute the main script from my terminal. However, sometimes I have to ssh into a server and run the main script from there, it fails as there isn't a ./ before each command.I'd rather not go through all the scripts and executables and add a ./ to the commands, so is there another way to solve this problem?
Run script without ./ before the name
bash;compiling;executable
There are ways to change this behavior including adding ./ to your PATH environment variable, but this introduces a serious security risk to your environment. The way your scripts are written is really wrong and the correct solution is to go through all of them and fix the way local scripts are called. This is the only proper fix that will not introduce extra problems down the road and create security issues for you. I know it's not what you wanted to hear, but bite the bullet and do it right.