View Single Post
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#256
Originally Posted by RafaLL92 View Post
Same happens in my case meaning that the script does not seem to work for me...
What could I have done wrong?
As you're getting errors even before the first echo statement, I'd guess that you've saved the file in DOS format, not in UNIX format. You should be able to convert it using either sed/tr (either of the following two lines - the ^M is generated by pressing Ctrl-V followed by Ctrl-M):
Code:
tr -d '\r' < DOS_file > UNIX_file
sed 's/^M//' DOS_file > UNIX_file
 

The Following 2 Users Say Thank You to Rob1n For This Useful Post: