There is a script which just adds extra lines to my /etc/hosts file to enable local development. Since it's pretty useful, I decided to keep it in a gist.
When one of my friends downloaded the shell-script, changed the necessary permissions and tried to run it, it failed.
The error shown is:
$ ./dev-mode
: No such file or directory
Even though the script runs perfectly file on my computer. The /etc/hosts file exists in both our computers, the permissions and the owners are the same. Every thing is absolutely similar.
Then he made a new file, copied the contents of the script to the new file, and changed the necessary permissions, and it RAN!
To my eyes, there is no conceivable difference between the two files, but a diff does that they are difference, but doesn't highlight any line or any character... Nothing. The permissions are same, etc.
Does ubuntu treat downloaded files somehow differently, and stop it from running?
Absolutely same files, one runs and the other doesn't
cd ~/Desktop
and then launch it./dev-mode
. Or he can use the full path$HOME/Desktop/dev-mode
. To know the directory in which the terminal is placed there exists the useful commandpwd
.history
can help).