Uploaded image for project: 'Gateway'
  1. Gateway
  2. GTWY-1863

tokenless wget scripts contain LRCR line terminations making them unexecutable on unix

XMLWordPrintable

    • Icon: Defect Defect
    • Resolution: Done
    • Icon: Minor Minor
    • 1.2.0
    • 1.2.0-BETA2
    • Data Download
    • 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.

              wilhelmi Nathan Wilhelmi (Inactive)
              stephen.pascoe Stephen Pascoe (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: