![]() |
|
|
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 |
| Just a quick question about SSH | jeffpas | UNIX for Dummies Questions & Answers | 4 | 02-21-2008 09:34 PM |
| Help with AWK -- quick question | Probos | Shell Programming and Scripting | 5 | 07-18-2007 05:26 PM |
| quick question | pkolishetty | UNIX for Dummies Questions & Answers | 2 | 09-02-2006 12:56 PM |
| quick question | penfold | Shell Programming and Scripting | 2 | 03-18-2005 06:15 AM |
| A Quick Question | DPAI | UNIX for Dummies Questions & Answers | 4 | 04-01-2002 06:02 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
I am using sed to find a pattern in a line and then I want to retain the pattern + the rest of the line. How is this possible? ie: Code:
line is: 14158 05-15-08 20:00 123-1234-A21/deliverable/dhm.a
search for 123-1234-A21 ie:
echo $line | sed 's/.*\([0-9]\{3\}-[0-9]\{4\}-[0-9A-Z]\{3\}[A-Z]\{5\}\).*/\1/'
want to retain 123-1234-A21/deliverable/dam.a Is using sed the best option for this? currently it only retains the 123-1234-A21 Thanks! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|