I have a shell script working on SCO Unix 5.0.6. The problem is when I copy the script to another machine with SCO Unix 5.0.7 (and also other OS) then it is not running. It shows a syntax error.
Note that when I copy all instructions and paste them in command line then they work perfectly. However, as I said they are not working as one script file.
As example in the script I have:
case "${MODUS}" in
And I get the below error:
syntax error near unexpected token '$'in\r''
Base on the error it seems to me something is added at the end of each instruction.
In some cases when the error is at the end of the instruction I can fix the problem. I add a space and #(to consider the rest line as comment) at the end of each instruction. Then it works. However, the problem is that I cannot do that for all instructions. In some cases the error is in middle of the instruction and then (space#) not working.
Please let me know what is the reason for the error and how can I fix that.