Adding to the front of a line

Smoot Carl-Mitchell smoot at tic.com
Tue Jan 20 03:57:31 UTC 2009


Here is a perl one liner which does what you need:

perl -pi -e 's/^/127.0.0.1 /' file file ...

See "man perlrun" for an explanation of the perl options that make this
work.
-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list