added text to every line of a file
Chris Wong
wongc at math.ed.hawaii.edu
Fri Jan 26 11:29:16 PST 2001
On Fri, 26 Jan 2001, Mike Ballon wrote:
> I have an 'ip block list' that gets sent to me every month containing anywhere
> from 250-500 lines. To add this to my router's access-list I have to insert
> "access-list 100 deny ip host" at the beginning of every line. I believe this
> can be done with sed and awk but I haven't been able to do it, help a brother
> out.
>
> Would also be nice to add "any log" at the end of every line as well.
cat file | awk '{ print "access-list 100 deny ip host", $0, "any log" }'
Been doing some awk work. nice stuff.
More information about the LUAU
mailing list