I have a build script. It was created on Linux. For some reason, I got it to windows and modified it. And brought it back again to Linux.
Since there is the question of the ^M chars appearing, the way out is to do a dos2unix on the script file. This is done manually.
Is there a way to call dos2unix on the script from within the script itself ?
I tried the following:
The first line in the script was
dos2unix $0
The error I got was:
sh build.sh
: command not found
dos2unix: converting file build.sh to UNIX format ...
to UNIX format ...g file
dos2unix: problems converting file
: command not found
: command not found
'uild.sh: line 30: syntax error near unexpected token `
'uild.sh: line 30: `function o ()
Any pointers ?
Vino