I tried executing a script with this command:
but it doesn't work:
No such file or directory
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
The leading dot in your command means "relative to the current directory". Remove it and it'll refer to "the file
someScript in the directory
If you get "Permission denied", it's either because you do not have sufficient permissions to access the file in the directory of other users or because the file is not executable. To make it executable, run:
chmod +x /home/user/scripts/someScript
If you make the scrip executable with
chmod 755 <nameofscript> to run it you only need to type the path to the script.
When you see
./script being used it telling the shell that the script is located on the same directory you are executing it. To use full path you type
I tried many ways and that's working well with me:
(cd ~/user/scripts/; ./someScript)
I get some help from this answer.