The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 06-24-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,082
The notation can be confusing (it's alien, really). But it's worth learning. I thought I knew it pretty well, but some of the stuff I see here is really awesome.

To answer your questions, I don't know what :g//d does. g generally means "global" and d "delete", but in the VI I'm using it doesn't work.

You already know what \(...\) means, you said.

s/.*//g means replace everything with nothing (where /.*/ means everything and // means nothing).

To replace

Code:
begin {}
With

Code:
%
Code:
:%s/begin {}/%/