![]() |
|
|
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 |
| extracting a number from a string | ROOZ | Shell Programming and Scripting | 6 | 06-06-2008 03:14 PM |
| Extracting a string from one file and searching the same string in other files | mohancrr | Shell Programming and Scripting | 1 | 09-19-2007 04:17 AM |
| Extracting part of a string | sam_78_nyc | Shell Programming and Scripting | 8 | 04-25-2007 08:37 PM |
| extracting from a string | preetikate | Shell Programming and Scripting | 1 | 03-11-2004 08:08 AM |
| Extracting String from a list | odogbolu98 | Shell Programming and Scripting | 4 | 06-01-2002 03:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
extracting a string
Hi All,
I am writing a shell script for which I am stuck with an extraction part. I arrived till extraction of a path of file. Lets take an example. I now have a file which contains following one line: 2348/home/userid/mydir/any_num_dir/myfile.text Now I want to extract only "/home/userid/mydir/any_num_dir/" part of the string. Note that initial number can be anything, any number if digits. To simplify the problem statement, I want to extract from a line, only part which is between first "/" and last "/", test should be ignored. I need this because I want to change directory to /home/userid/mydir/any_num_dir/ Please help. Thanks! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|