Go Back   Linux Forums by TotalPenguin! Get linux Help! > Linux > Linux General

Linux General Any questions that are not covered by other forums go here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-15-2008, 01:49 PM
Member
 
Join Date: Jan 2007
Posts: 96
Prog is on a distinguished road
Default Replace all strings with vi

Is there a way in vi to replace all occurrences of a string with another string? Such as:

DEPAR with DEPARTMENT

??
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 02-15-2008, 05:45 PM
Super Moderator
 
Join Date: Dec 2007
Location: Denmark
Posts: 273
v0id is on a distinguished road
Send a message via MSN to v0id
Default

This works in Vim, but I think it'll work in Vi too.
Code:
:%s/DEPAR/DEPARTMENT/g
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 01:49 AM
Jordan's Avatar
Administrator
 
Join Date: Nov 2006
Posts: 570
Jordan is on a distinguished road
Default

v0id's suggestion works on vim as well as vi. Most Linux systems now use an alias for vi and actually execute vim when you type vi. After all, vim is only vi improved.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Open Source Challenge. How to replace Windows completely with Ubuntu. kernel Linux News 6 06-24-2008 01:25 PM


All times are GMT. The time now is 02:51 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.