You are not logged in.

#1 2005-12-12 06:17:47

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

vim hidden ^M

This is really weird; vim was working beautifully for me, but now it's not.

If I put the following into an executable file using e.g. nano:

#!/bin/bash
grep fruit ./food.txt

then it works fine when run.

However, doing the same thing with vim gives me

: bad interpreter: No such file or directory

which is usually a sign that you've got ^M endlines left over from DOS or XP. However, I'm writing the file myself, so can't understand why this is happening. Doing a :%s/^M//g produces a Pattern not found message in vim, yet simply going to the start of the second line of the above script in nano and pressing backspace then enter solves the problem (the script will then run).

This is seriously odd; I haven't added anything to my .vimrc, and the only thing I've changed recently is my .screenrc, but the changes were only key bindings... I've tried vim in urxvt without screen running, and still the same problem arises.

What gives?


.oO Komodo Dave Oo.

Offline

#2 2005-12-13 09:14:30

Kern
Member
From: UK
Registered: 2005-02-09
Posts: 464

Re: vim hidden ^M

maybe a  binary option problem, check [url=http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#5.4] here
[/url]

Offline

#3 2005-12-14 13:30:43

Komodo
Member
From: Oxford, UK
Registered: 2005-11-03
Posts: 674

Re: vim hidden ^M

You were completely correct Kern; that's solved the problem.

Thanks loads big_smile


.oO Komodo Dave Oo.

Offline

Board footer

Powered by FluxBB