|
Search Forums:
|
|||||||
| Forums | Register | Forum Rules | Linux and Unix Links | Man Pages | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
vi command
What is the command in 'vi' that I can replace the right most '/' with a space?
In a file, the directory level is various and I need a space between the directory path and file name: i.e (before) dir1/dir2/dir3/dir4/file dir1/dir2/dir3/dir4/dir5/file dir1/dir2/dir3/dir4/dir5/dir5/file I want it to be (after) dir1/dir2/dir3/dir4 file dir1/dir2/dir3/dir4/dir5 file dir1/dir2/dir3/dir4/dir5/dir6 file comments and helps are appreciated. |
| Sponsored Links | |
|
|
|
#2
|
||||
|
||||
|
Code:
%s,/\([^\/]*\)$, \1, |
| Sponsored Links | ||
|
|
|
#3
|
|||
|
|||
|
Thanks for reply.
ignore my previous comment. The command works Last edited by ywu081006; 03-09-2010 at 05:24 PM.. |
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can anyone help with shell script command about searching word with grep command? | aintour | Shell Programming and Scripting | 2 | 10-14-2009 04:51 PM |
| problem with output of find command being input to basename command... | new_learner | UNIX for Dummies Questions & Answers | 2 | 12-14-2008 01:56 AM |
| awk/sed Command : Parse parameter file / send the lines to the ksh export command | rajan_san | Shell Programming and Scripting | 4 | 11-06-2008 12:29 PM |
| assign a command line argument and a unix command to awk variables | sweta_doshi | Shell Programming and Scripting | 0 | 08-08-2008 06:54 AM |
| Help Required: Command to find IP address and command executed of a user | loggedout | Security | 2 | 08-06-2008 08:12 PM |
|
|