Skip to contentSkip to conversation

ctrl-M

DISCUSSION Shawn Ashlee 2 participants 2 messages Aug 27, 2003

lore
Share & tools
lore
#0 lore raw

I have a bash script writting to a .procmailrc file, but it is putting in ctrl-M's where I have \r or \015. You can see them in vi but not when you cat the file. It wouldn't be a problem, but procmail cant read it with those in there. I tried \n, but it adds alot of blank lines. The archives mostly talk about compatability for dos/linux, but that doesnt help me.

Thanks,
Shawn

#1 lore raw
Quoted 6 lines · Shawn Ashlee

I have a bash script writting to a .procmailrc file, but it is putting in ctrl-M's where I have \r or \015. You can see them in vi but not when you cat the file. It wouldn't be a problem, but procmail cant read it with those in there. I tried \n, but it adds alot of blank lines. The archives mostly talk about compatability for dos/linux, but that doesnt help me.

There are a lot of options for converting files between 'dos' style (\r\n as line separators) and the 'unix' style (only \n is used):

* dos2unix or unix2dos
* tr -d '\r' < dos_file > unix_file
* vi: edit file and set the fileformat option to unix or dos and save:
vi zbr
:set fileformat=unix
ZZ

Regards,
Luciano Rocha