Allen C BrownMon Jun 6 12:08:13 PDT 2005
> Was there a question to that, or was it a simple complaint?
The explicit question was how this could have happened.
We want to avoid it from happening in the future. We now
have a clue about this. Here is a more detailed description
of the action sequence.
1. Edit a DOS file in vim.
2. Without exiting vim, open up a new file.
This new file is the script.
It appears that vim gets stuck in DOS mode after step 1 so
that any new files you create are then DOS. Disgusting.
There is a command to set the mode. Something like
set fileformat=unix
I'm not a vim user, so I don't know exactly what it is.
The guy who is is wondering if there is something he can
put into his .vimrc file to cause ALL files to default to
unix format. Or even to force all files to unix format.
The implicit question was how to get these editors to
show the control characters. Emacs used to. What changed
in its design?
--
Allen Brown
work: Agilent Technologies non-work: http://www.peak.org/~abrown/
allen_brown at agilent.com abrown at peak.org
Beyond a doubt, all stories about large bodies of Indians being here
are the merest bosh. -- General George Armstrong Custer, 1876, a few
weeks before being massacred by a large body of Indians at Little Big
Horn
> Quoth Allen C Brown, on Mon, 06 Jun 2005 11:14:19 -0700:
>
>
>>A guy here at work created a file in vim on an NFS mounted
>>filesystem. The first line was
>> #!/bin/bash
>>As long as that line was there the script failed with
>> : bad interpreter: No such file or directory
>>
>>I pulled it up in emacs, figuring that any control chars
>>would be visible. Nothing.
>>
>>After beating on it for a long time I finally ran
>> cat -v bash_test
>>and saw the nasty \r in the lines.
>>
>>I am pissed off that some bozo changed emacs so that it now
>>gives no indication of this problem. And it doesn't show DOS
>>mode or anything in the status line. And vim did the same
>>thing. Both editors preserved the CR chars.
>>
>>Any clues how this could have happened? Vim should never have
>>created a DOS file in the first place. But emacs should then
>>have exposed the insanity.
>>
>>We are running 2.4.21-27.0.1.ELsmp under RHE3.
>>--
>>Allen Brown