Solved

VI Editing

Posted on 1997-09-16
2
257 Views
Last Modified: 2013-12-16
Greetings

I am looking for a vi command to replace a string in my passwd file.
Eg.:
 .......:/home/username:bin/xsh ,I want to replace the dir. /home with
/export/home.

To change /home for eg. to /export I use the following command:
:g/home/s/home/export/, How do I change /home to /export/home

Thanks
Vulcan

0
Comment
Question by:Vulcan081897
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
n0thing earned 50 total points
ID: 1812696
Hi,
   "/" is a reserved word .. so in order to say you want a "/"
you have to append "\" before it ... so "\/" is a "/"

:%/\/home/\/export\/home/g
or
:g/\/home/\/export\/home/

Regards,
Minh Lai

0
 

Author Comment

by:Vulcan081897
ID: 1812697
Thanks
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question