Help with vi editor | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Help with vi editor

UNIX for Dummies Questions & Answers


Tags
find & replace string, solved, vi

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-18-2013
gonchusirsa gonchusirsa is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 15 February 2013, 3:00 AM EST
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
[Solved] Help with vi editor

Hi,

In vi editor for search and replace , I used to use :%s/'thing-to-be-searched'/'replace-thing'/.

Now i came across this line :%s/^/##hello#/

Can someone help me decipher this line.

Thanks in advance.
Cheers
Sponsored Links
    #2  
Old 01-18-2013
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 23 April 2014, 8:20 PM EDT
Location: Galactic Empire
Posts: 3,284
Thanks: 227
Thanked 1,158 Times in 1,095 Posts
%s/^/##hello#/ matches the start of every line and prepends or add to the beginning the pattern ##hello#

For further reference vimregex
The Following User Says Thank You to Yoda For This Useful Post:
gonchusirsa (01-19-2013)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
[Solved] Help with running ps -e | less on nano script editor SANA4SPA Shell Programming and Scripting 2 10-22-2011 07:38 PM
[solved] merging two files and writing to another file- solved mlpathir Shell Programming and Scripting 1 10-07-2010 06:41 PM
Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen durgaprasadr13 Solaris 1 10-13-2008 07:39 AM
set EDITOR=vi -> default editor not setting for cron tab aarora_98 Shell Programming and Scripting 6 09-13-2008 02:01 AM
Pasting text in VI editor from a different editor harishmitty UNIX for Dummies Questions & Answers 10 09-10-2008 06:22 PM



All times are GMT -4. The time now is 09:34 AM.