Adding to the front of a line
crp at cmc.net
Tue Jan 20 02:54:56 UTC 2009
Matthew Flaschen wrote:
> Matthew Flaschen wrote:
>> Ray Parrish wrote:
>>> I've downloaded a text file of the new sites to block to avoid the
>>> conficker worm that is currently infecting Windows users, and would like
>>> to send it to my Windows using friends and family. However the file
>>> unfortunately has only the host names, one per line. I would like to add
>>> the 127.0.0.1 and a space to the front of each line in the file before I
>>> send it out, so all they have to do is copy and paste it's contents to
>>> the end of their hosts files.
>> There are many ways. Here's one:
>> while read site; do
>> echo "$site 127.0.0.1"
>> done < sites.txt > output_file.txt
> Whoops. That was backwards. It should be:
> while read site; do
> echo "127.0.0.1 $site "
> done < sites.txt > output_file.txt
Thank you! My windows using friends and family will thank you too, if
they have actually taken my previous advice and started using a hosts
file. 8-) The article I read about that particular virus claims it has
infected 3.5 million computers so far, pretty sad state of affairs.
Long live Linux, and it's comparatively more secure system.
Later, Ray Parrish
http://www.rayslinks.com/ Web index of human reviewed links.
Trouble shooting and Fixing Windows
http://www.writingsoftheschizophrenic.com My poetry in web pages
More information about the ubuntu-users