> From: [EMAIL PROTECTED]
> Date: 2005/09/06 Tue PM 02:21:22 CDT

> does any one know a quick way to comment out all lines of a configuration 
> file other than open the file in vi and insert # at the beginning of each 
> line?

Okay, now that I'm done being funny (ha freaking ha, right), you can 
use Perl to do it...

perl -p -i.back -e 's/<oldstring>/<newstring>' <filename> 

You should be able to replace <oldstring> with \n (or (\r\n, depending on 
platform), and replace <newstring> with the same thing plus a #...

HTH,
amonotod


--

    `\|||/         amonotod@    | sun|perl|windows
      (@@)         charter.net  | sysadmin|dba
  ooO_(_)_Ooo____________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|
_______________________________________________
Solaris-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/solaris-users

Reply via email to