The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with SED and forward slash gseyforth Shell Programming and Scripting 3 05-26-2008 08:29 AM
ftp username with back slash sam99 Shell Programming and Scripting 1 04-29-2008 10:19 AM
awk slash McLan Shell Programming and Scripting 6 04-09-2008 03:00 PM
grep for forward slash wxornot Shell Programming and Scripting 3 02-29-2008 10:01 PM
touching a file which contains slash char axes High Level Programming 1 09-25-2006 06:54 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-09-2008
christineida christineida is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 3
Replace the last slash alone

Hi All,
Can you please help me with the below issue.
I want only the last slash to be replaced with space.
06/05/2008/EDED_FD_BDCD_ABCD_123
06/05/2008 EDED_FD_BDCD_ABCD_123
  #2 (permalink)  
Old 07-09-2008
danmero danmero is online now Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,434
Try sed:

Code:
sed 's*.* *11'


Last edited by danmero; 07-09-2008 at 11:53 PM.. Reason: Have fun:)
  #3 (permalink)  
Old 07-10-2008
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 753

Code:
sed 's?^\(.*\)/\(.*\)$?\1 \2?'

  #4 (permalink)  
Old 07-10-2008
Annihilannic Annihilannic is offline Forum Advisor  
  
 

Join Date: May 2008
Location: Sydney, Australia
Posts: 1,009
Since .* is "greedy", this should suffice:


Code:
sed 's?^\(.*\)/?\1 ?'

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 08:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0