The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




Thread: Replace in VI
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 11-27-2008
FlyingSquirrel FlyingSquirrel is offline
Registered User
  
 

Join Date: May 2008
Posts: 38
Why count lines, use markers instead.

1) Go to the 1st line in range and type in
ma

2) Go to the last line in range and type in
mb

3) Then do the substitution
:'a,'b s/^/*/