Every time I run a script using
Command Not found
Command Not Found
echo Hello World
Make sure your first line is:
Enter your path to bash if it is not
That wil convert line endings, etc from Windows to unix format. i.e. it strips \r (CR) from line endings to change them from
\r\n (CR+LF) to
Another way to tell if your file is in dos/Win format:
cat scriptname.sh | sed 's/\r/<CR>/'
The output will look something like this:
#!/bin/sh<CR> <CR> echo Hello World<CR> <CR>
This will output the entire file text with
<CR> displayed for each
\r character in the file.
P.S. Sorry for the poor formatting, this was written from my iPhone while driving to work :p.