So, I tried to run some simple scripts to manage files in OSX 10.9.5, but every time I try to run a script, it first says that I do not have permission, so I sudo the command, but then throws the command did not find an error .
eg,
sudo ./hello.sh
after entering my password will result in
sudo: ./hello.sh: command not found
hello.sh script consists of this.
#!/bin/bash
echo 'hello world'
However, if I just run the command echo 'hello world'from the final line, it prints it just fine. I checked the wrong line endings, but they \ n
still new to terminal / command line, so the explanations will be awesome.
source
share