Solved

VI Editing

Posted on 1997-09-16
2
250 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
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

770 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