bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Feature request: DOS line endings recognition


From: Francesco Montorsi
Subject: Feature request: DOS line endings recognition
Date: Sun, 30 Oct 2005 16:49:07 +0100
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Hi,
I've found out (after trying almost everything else I could coinceive), that if I make a BASH script with DOS/WIN line endings instead of UNIX line endings, when I try to run that script I get the error message:

: bad interpreter: No such file or directory

this is rather useless as error message: I understand this is because after reading the first CR character, BASH reads the LF character and (maybe?) try to exec it and then shows this error.

So, my proposal/feature-request is:

1) make a better error message when executing scripts with CRLF line endings (maybe using a simple heuristics to check if a script file has CRLF endings)

2) auto-convert internally scripts with DOS line endings to UNIX line endings

This was really a problem for me, specially because I have to copy & edit files among unix & win machines. Obviously, now that I've found the cause of the error, I just need to use "dos2unix" to fix the problem, but I think that a better error message / handling of DOS line endings could help a lot of other people... ;)

Francesco





reply via email to

[Prev in Thread] Current Thread [Next in Thread]