Re: scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 03 March 2006 06:22, Paul Howarth wrote:
>Ian Malone wrote:
>> On 3/3/06, Paul Howarth <paul@xxxxxxxxxxxx> wrote:
>>>John Summerfied wrote:
>>>>Les Mikesell wrote:
>>>>>They were probably created under windows and transferred over
>>>>>with carriage-return, line-feed endings intact.  If you
>>>>>load them into vim, type :set fileformat=unix and save
>>>>>again it should fix them.  Or use the dos2unix program.
>>>>
>>>>Any more ways to change this light bulb?
>>>
>>>How about:
>>>
>>>sed -i -e 's/\r//' script
>>
>> g?
>
>For a straight dos2unix job, there should only be a single
>carriage-return character on each line, so the "g" flag shouldn't be
>necessary. However, it would probably be safer to use it in case there
>were other carriage returns in the file.

I don't believe this is 100% correct as the *nix's in general use a 
linefeed and assume a carriage return is implied when a linefeed is 
found in the data stream.

>Better still, anchor the replacement to the end of the line so as to
>leave other carriage return characters (which might be needed by the
>script) intact:
>
>sed -i -e 's/\r$//' script
>
>Paul.

-- 
Cheers, Gene
People having trouble with vz bouncing email to me should add the word
'online' between the 'verizon', and the dot which bypasses vz's
stupid bounce rules.  I do use spamassassin too. :-)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2006 by Maurice Eugene Heskett, all rights reserved.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux