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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed string manipulation speedieB Shell Programming and Scripting 4 1 Week Ago 05:27 PM
string manipulation james6 UNIX for Dummies Questions & Answers 5 06-03-2008 07:05 AM
string manipulation Cactus Jack Shell Programming and Scripting 9 02-14-2008 10:14 AM
shell program to reverse the string saikiran Filesystems, Disks and Memory 1 08-29-2006 04:57 AM
string in reverse malaymaru Shell Programming and Scripting 4 10-18-2005 08:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-29-2006
Registered User
 

Join Date: Mar 2006
Posts: 16
reverse string manipulation

How to get the reverse parsing work.

I have a strings like
aqw-wef-324-err.log
wefd-324r-err.log
efrt-4rfr.log
.
.
i want to have string upto last hypen.

aqw-wef-324
wefd-324r
efrt
Reply With Quote
Forum Sponsor
  #2  
Old 03-29-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,656
$ string=wefd-324r-err.log
$ string2=${string%-*}
$ echo $string2
wefd-324r
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0