|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
RegEX help needed
Hi,
Have to filter out string before the last underscore in the following input: UNIX_Solaris_59_KSH output: UNIX_Solaris_59 dummy one but ![]() Thanks & Regards, Sourabh Singh Khichi Last edited by vbe; 01-08-2013 at 09:00 AM.. Reason: icodes... |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Is the input stored in a file or in a shell variable?
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
ok with anything file or variable ..... any can help
|
|
#4
|
|||
|
|||
|
Assuming you're using ksh, here are two ways to do it: Code:
in=UNIX_Solaris_59_KSH
echo ${in%_*}
echo $in | sed 's/_[^_]*$//' |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
thanks a lot for your help
![]() |
| 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 |
| Regex Needed:( | jlaigo2 | UNIX for Dummies Questions & Answers | 6 | 10-31-2012 12:02 PM |
| Help needed in regex | lorzinian | Shell Programming and Scripting | 2 | 10-09-2012 09:21 AM |
| perl regex help needed | zing_foru | Shell Programming and Scripting | 8 | 09-16-2012 11:34 AM |
| Regex help needed | Bloomy | Shell Programming and Scripting | 1 | 03-19-2012 10:54 AM |
| Sed and regex help needed | marknu1 | Shell Programming and Scripting | 9 | 08-08-2008 02:13 PM |
|
|