NetBSD-Users archive

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

Re: Why doesn't NetBSD recognize my entries in /etc/hosts?



Other ways to get rid of the CRs are the "dos2unix" filter and opening
in vim, setting :set fileformat=unix and saving.

On Fri, Sep 18, 2015 at 8:08 AM, Ottavio Caruso
<ottavio2006-netbsd%yahoo.com@localhost> wrote:
> On 18 September 2015 at 03:29, Eric Haszlakiewicz <erh%nimenees.com@localhost> wrote:
>> On 9/17/2015 1:32 PM, Ottavio Caruso wrote:
>>>
>>> On 16 September 2015 at 23:13, Matt Sporleder <msporleder%gmail.com@localhost>
>>> wrote:
>>>>
>>>> Show us a sample hosts entry and the full output of your ping, please.
>>>
>>> Ok, this is not necessary now.
>>>
>>> For some reasons, I have redone the whole process today and the
>>> entries were correctly redirected to 0.0.0.0 as expected.
>>>
>>> There must have been a file corruption when downloading the file from:
>>> http://winhelp2002.mvps.org/hosts.txt
>>>
>>> The first time I just downloaded it with wget.
>>>
>>> Now I have selected all text and copied it into leafpad, then moved it
>>> to /etc/hosts.
>>>
>>> There might have been some extra line feed that could have prevented
>>> the file from being parsed correctly.
>>
>> Yep, there definitely are carriage returns (not line feeds), but it's not
>> file corruption, it's just a MS Windows style text file.
>> If you open it in vi you'll clearly see all the "^M"'s at the end of each
>> line.
>>
>> Assuming you'll want to fetch an updated copy of that file in the future,
>> you can automatically trim those off with something like this:
>> ftp -o - http://winhelp2002.mvps.org/hosts.txt | tr -d '\r' > hosts.txt
>>
>> (wget should work too, but NetBSD's ftp does what you need without any extra
>> packages)
>>
>
> Thank you for the tip. I've bookmarked it for the future.
>
>
>
> --
> Ottavio



-- 
The first essential in chemistry is that you should perform practical
work and conduct experiments, for he who performs not practical work
nor makes experiments will never attain the least degree of mastery.
        -- Abu Musa Jabir ibn Hayyan (721-815)


Home | Main Index | Thread Index | Old Index