![]() |
|
|
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 |
| How to Extract string? | namrata5 | High Level Programming | 2 | 10-24-2007 04:17 AM |
| Extract digits at end of string | offirc | Shell Programming and Scripting | 6 | 11-20-2006 11:57 AM |
| Extract String | sehgalniraj | UNIX for Dummies Questions & Answers | 1 | 09-25-2006 01:35 PM |
| Extract String | bestbuyernc | Shell Programming and Scripting | 5 | 11-14-2005 03:42 PM |
| How to extract a portion of a string from the whole string | ds_sastry | UNIX for Dummies Questions & Answers | 2 | 09-29-2001 11:40 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
hi, I want a simple way to extract string between two angle brackets <> the text looks like echo "###Usage: $0 <database1> <database2>" what I want is two variables DB1=database1 and DB2=database2 What I am doing looks clumsy to me Code:
DB1=`echo $line | sed 's/"//g' | sed 's/>//g' | awk -F"<" '{print $2}'`
DB2=`echo $line | sed 's/"//g' | sed 's/>//g' | awk -F"<" '{print $3}'`
thanks in advance |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|