![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replacing Last occurance of & from a string | vivekshady | Shell Programming and Scripting | 1 | 05-13-2008 09:15 PM |
| shell script for extracting out the shortest substring from the given starting and en | pankajd | Shell Programming and Scripting | 18 | 03-10-2008 06:20 AM |
| problem extracting substring in korn shell | nashrul | UNIX for Dummies Questions & Answers | 3 | 08-15-2007 03:45 AM |
| sed, grep, awk, regex -- extracting a matched substring from a file/string | ropers | Shell Programming and Scripting | 2 | 05-23-2006 02:56 PM |
| Removing the last occurance of string | dkhanna01 | Shell Programming and Scripting | 7 | 12-28-2004 05:46 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Extracting a substring starting from last occurance of a string/character
Hi All,
This is Ram. I'm new to this forum & new to shell scripts as well. I've a requirement in which I want to extract a substring from a given string based on last occurance of a character. for eg. I have a string of a file name with absolute path like $filename=/aaa/bbb/ccc/ddd/xyz.txt I want to extract only the actual file name ie, xyz.txt The no. of directories ie, / will be dynamic. So I want to find the last occurance of / in the given string & to extract the string after the last / can I have some ideas / suggestions please. Thanks , Ram. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|