Jon Nelson on 23 Dec 2004 15:44:06 -0000


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

Re: [PLUG] awk question


Alexander Birch said:
>
> would bar.tmp contain the contents of the last html file? Instead of
replacing the ip address with the domain name in each of the files?

Nope.  It takes each html file in the current directory, replaces the IP
with the domain, and dumps all the contents into bar.tmp.  Which is not
what he wanted...just saying redirection worked.

This does work though:

    awk '{ gsub("207.106.32.241","ancss.org"); print > FILENAME ".tmp"}'
*.html

and I believe it was what he was looking for. ;)

Jon
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug