I have this issue of "./script1.sh not found" when called from another script2.sh which is actually bounded to a keyboard shortcut (control+e).
When I press control+e the script2.sh instantly opens up a new terminal and starts performing its task, but when it has to make a call to script1.sh, it shows this error i.e: sh: 1: ./script2.sh: not found
it works fine when I run it manually in the terminal which is meant to be the current working directory i.e HOME, but it doesn't work when starts from the shortcuts i.e control+e, it perform half its task.
The problem is that these scripts have set different paths as
"./exampleProgam"
or "./exampleScript"
and doesn't have a full path like "/home/user/program"
or "/home/user/script"
.
So i don't want to go throw around 70 files and manually change paths one by one to full paths like "/home/user/folder". I will also have to write extra code in order to get the home dir path.
All these scripts and C programs are placed in one folder i.e folder1 in the home direcory: /home/user/folder1/script2.sh
while script1.sh is placed in the
/home/user/script1.sh
.
and where does the terminal shell opens up by default.?? becuase when i press the control+e and the program starts in the shell , it doesn't shows any path etc but just starts executing.