LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2010, 09:22 PM   #1
Dru-Jitsu
Member
 
Registered: Jun 2010
Posts: 38

Rep: Reputation: 15
Vi is fun for everyone!


Using vi change every occurance of **/**/** to the word NEVER. Note that both the * and the / are special charaacters to the search and replace :s/abc/def/g command so you must escape each one of these characters (that's eight backslashes).

heres what I am doing
1,$ s/ \*\*\/\*\*\/\*\* /NEVER/g doesnt work (Spaces are there to make it easier to read)
 
Old 06-26-2010, 09:33 PM   #2
Dru-Jitsu
Member
 
Registered: Jun 2010
Posts: 38

Original Poster
Rep: Reputation: 15
I just ran it without the 1,$ at the beggining...

s/ \*\*\/\*\*\/\*\* /NEVER/g

It searched and found all the of the **/**/** but it only changed the very last one to NEVER.
 
Old 06-27-2010, 02:46 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,250

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Code:
:%s/\*\*\/\*\*\/\*\*/NEVER/g
Worked like a charm for me. In case you are not sure, the % is the same as 1,$
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
<fun> The Windows Crash </fun> Simon Bridge General 6 08-26-2007 08:46 PM
Just for fun neo77777 General 0 09-24-2002 07:42 PM
Just for FUN! How would you... macdudelx Linux - General 18 08-11-2002 02:34 AM
Fun with my new billsabub Linux - Software 4 02-09-2001 04:16 PM


All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration