I'm having a very weird error when trying to make a script callable. I have a scripts directory in /srv/projectname/scripts where I store you know scripts to be called as cron jobs for different projects. I'm trying at add a new one and seeing very weird behavior. In debugging I reproduce it using this set of commands
from /srv/projectname/scripts create a file create a file
insert text exactly:
#!/usr/bin/env bash echo "Hello World!"
Make the script executable and try to call it:
chmod +x helloworld.sh ./helloworld.sh
-bash: ./helloworld.sh: Permission denied
Make sure there isn't a code error:
Copy the script to home and call it:
cp helloworld.sh ~/helloword.sh ~/helloword.sh
I have no idea what is going on. I have tried a lot of variants where I give the full path, same error, or if I sudo which gives no error, but also doesn't print "Hello World!".
Other details: Running on: Ubuntu 12.04.4 LTS I have also noticed that I can't tab-complete to the full name of a script that gives me this error, but I can once I have moved it. The directory /srv/projectname is a git repo but this script hasn't been added to it yet, I because I usually only do that once its working yet.
ls -l lines for the script and scripts directory are
-rwxrwxr-x 1 ubuntu ubuntu 41 Apr 21 20:25 helloworld.sh drwxrwxr-x 3 ubuntu ubuntu 4096 Apr 21 20:25 scripts
Any help would be awesome.
EDIT: Gilles had the answer. To save anyone else who has this problem a google search.
sudo mount /srv/projectname/ -o remount
reloads the edited fstab, and everything works again.
ls -l /srv/projectname/scriptsto your question.