-
Defect
-
Resolution: Done
-
Minor
-
1.2.0-BETA2
-
None
A tokenless wget script uses dos-line termination characters. This interferes with execution by /bin/sh on linux in two ways that are not easy to detect:
1. making the script executable doesn't work
$ chmod u+x wget-download.txt.orig
$ ./wget-download.txt.orig
bash: ./wget-download.txt.orig: /bin/sh^M: bad interpreter: No such file or directory
2. sh flags a mysterious syntax error when invoked
$ sh wget-download.txt.orig
: not foundad.txt.orig: 5:
wget-download.txt.orig: 10: Syntax error: "elif" unexpected (expecting "then")
This error is really difficult to detect because the script looks normal.
1. making the script executable doesn't work
$ chmod u+x wget-download.txt.orig
$ ./wget-download.txt.orig
bash: ./wget-download.txt.orig: /bin/sh^M: bad interpreter: No such file or directory
2. sh flags a mysterious syntax error when invoked
$ sh wget-download.txt.orig
: not foundad.txt.orig: 5:
wget-download.txt.orig: 10: Syntax error: "elif" unexpected (expecting "then")
This error is really difficult to detect because the script looks normal.