[Clfs-support] xorg 7 script problem

Rob Landley rob at landley.net
Fri Apr 1 02:24:10 PDT 2011


On 03/31/2011 10:03 PM, Randolph D Dach wrote:
> On Tue, 29 Mar 2011 08:45:50 -0400
> Joe Ciccone <jciccone at gmail.com> wrote:
> 
>> On Mon, 2011-03-28 at 13:03 -0600, Randolph D Dach wrote:
>>
>>> grep: done: No such file or directory
>>> applewmproto-1.4.1.tar.bz2
>>> applewmproto-1.4.1
>>> tar: applewmproto-1.4.1.tar.bz2\r: Cannot open: No such file or directory
>>> tar: Error is not recoverable: exiting now
>>
>> The \r would be the CR added to the end of the line in a windows
>> environment where a CRLF is a standard line ending. On linux a LF is
>> standard. Use a program such as dos2unix to strip the inappropriate line
>> endings out of the file.
>>
>> Eg, each line in your file looks like this (windows)
>> applewmproto-1.4.1.tar.bz2\r\n
>> where it should look like this (linux/unix/bsd/mac)
>> applewmproto-1.4.1.tar.bz2\n
>  
> This was the only method I tried that worked using dos2unix
> kind of strange, if I used vim to create a file with sentences in the lines  such as in this email, it would save the file such that when I used cat -A file  it would show the lines as 
> the black cat$
> the brown cow$
> however if I used vim to type and save the file
> applewmproto-1.4.1.tar.bz2
> bigreqsproto-1.1.1.tar.bz2
> 
> and I used cat -A file it listed the lines as
> applewmproto-1.4.1.tar.bz2^M$
> bigreqsproto-1.1.1.tar.bz2^M$
> 
> using dos2unix removed the ^M$ which I assume is the \CR in windows  everything worked as it was supposed to.
> 
> this is the first time I've run into this issue.
> 
> Tks

If you haven't got dos2unix lying around, you can always do:

  sed -i $(echo -e 's/\015$//') filename

Which is vaguely disgusting but "works for me".  (This comes up a lot
saving entries out of my mbox to apply inline patches from linux-kernel.)

Rob



More information about the Clfs-support mailing list