Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I think I ran across a bug in a batch file because it was written with unix line endings. Is this a known problem with cmd.exe running batch files in windows?

share|improve this question
    
I have never had a problem, and I always use unix line endings. But that doesn't mean that there isn't some problem I have just been lucky enough to miss. –  Zoredache Sep 18 '12 at 19:19
    
Which bug did you run into? Commands failing to start? Or just that it looked as if there are not line endings when you open the file with notepad? –  Hennes Sep 18 '12 at 19:21

1 Answer 1

up vote 4 down vote accepted

This really isn't a "bug"... as it is by-design. Windows new-lines are defined as "\r\n" ... or a "Carriage Return" and "New Line" combination... whereas *nix flavors prefer omitting the carriage return. You should always use "\r\n" in anything in Windows where possible. Anything else may be interpreted incorrectly... and cause a great deal of unexpected results.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.