Solved

VI Editing

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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 …
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now