Unix/Linux Go Back    

UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Help with vi editor

UNIX for Dummies Questions & Answers

find & replace string, solved, vi

Thread Tools Search this Thread Display Modes
Old Unix and Linux 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


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 Unix and Linux 01-18-2013
Yoda's Unix or Linux Image
Yoda Yoda is offline Forum Advisor  
Jedi Master
Join Date: Jan 2012
Last Activity: 20 October 2017, 8:14 PM EDT
Location: Galactic Empire
Posts: 3,571
Thanks: 253
Thanked 1,300 Times in 1,219 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 08:08 AM.