Reputation: 650
demo.sh has following line:
. ./one.sh > ../Results/myResult.txt 2>&1
when i run ./demo.sh it is giving:
ambiguous redirectine 1: 1
But the myResult.txt gets created at appropriate location with size 0 KB.
If i remove the redirection of output, it script works fine. What is wrong with my script? I have gone through Ambiguous output redirect on solaris, shell script ambiguous redirect, ambiguous redirect - file gets created. Nothing helped though.
Upvotes: 1
Views: 224
Reputation: 58352
If you're saving your script with DOS-style line endings (CRLF instead of LF), that can produce all of the symptoms you're seeing.
Change the line endings using the text editor or command-line utility of your choice, then try again.
Upvotes: 1