![]() |
|
|
|
|
|||||||
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. Shell Script Page. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| searching and storing unknown number of lines based on the string with a condition | swamymns | Shell Programming and Scripting | 7 | 05-12-2008 10:02 PM |
| Searching for a string variable | mattrix | UNIX for Dummies Questions & Answers | 2 | 03-04-2008 12:04 PM |
| Storing a variable? | hoover90 | Shell Programming and Scripting | 4 | 01-26-2008 05:39 PM |
| Storing string with space | rahul303 | Shell Programming and Scripting | 4 | 10-04-2007 07:26 AM |
| Storing values in variable | matrixmadhan | Shell Programming and Scripting | 1 | 03-31-2005 10:56 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
sed - searching for string and storing in variable
Hi
I'm trying to find a way to search a text file for a specific string. I have a file which contains i.p. addresses and port numbers in the following format: 'ip="www.xxx.yyy.zzz"' 'port="xx""' I want to print only the parts between the double quotes for use in seperate variables, if this makes sense. I do not want to store the i.p=" " or port=" " parts of the string. Also the i.p. and corresponding port number are on the same line, if this helps. This is what the actual line looks like: <LS id="group1" ip="www.xxx.yyy.zzz" port="aa" acceptorthreads="1" security="off" defaultvs="http-test-http" servername="test.test.com" > Thanks in advance. |
| Forum Sponsor | ||
|
|
| Thread Tools | |
| Display Modes | |
|
|