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

find & replace string, solved, vi

Closed Thread    
Thread Tools Search this Thread Display Modes
Old 01-19-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


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.
Sponsored Links
Old 01-19-2013
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
Join Date: Jan 2012
Last Activity: 28 January 2015, 10:51 AM EST
Location: Galactic Empire
Posts: 3,401
Thanks: 240
Thanked 1,215 Times in 1,141 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 08:38 PM
[solved] merging two files and writing to another file- solved mlpathir Shell Programming and Scripting 1 10-07-2010 07:41 PM
Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen durgaprasadr13 Solaris 1 10-13-2008 08:39 AM
set EDITOR=vi -> default editor not setting for cron tab aarora_98 Shell Programming and Scripting 6 09-13-2008 03:01 AM
Pasting text in VI editor from a different editor harishmitty UNIX for Dummies Questions & Answers 10 09-10-2008 07:22 PM

All times are GMT -4. The time now is 12:12 PM.