![]() |
|
|
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 |
| Insert line break in vi's command mode | Skogsmulle | UNIX for Dummies Questions & Answers | 3 | 07-06-2007 11:47 AM |
| Replacing characters in file with line break | johnemb | Shell Programming and Scripting | 10 | 04-26-2007 08:38 AM |
| Sed Help (Using expression - line break) | Janus | Shell Programming and Scripting | 2 | 02-16-2007 08:50 PM |
| Remove Line Break | Rock | Shell Programming and Scripting | 5 | 02-06-2007 09:54 AM |
| Trim whitespace and add line break | moose1 | Shell Programming and Scripting | 7 | 01-22-2007 01:53 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
TO break a line
hi All,
Have a doubt in ksh..Am not familiar with arrays but i have tried out a script.. plzzzzz correct me with the script My i/p File is: (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = 192.168.2.2) (Port = 1525) ) ) (CONNECT_DATA = (SID = TESTDB1) ) ) (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = 192.168.2.4) (Port = 1525) ) ) (CONNECT_DATA = (SID = TESTDB2) And My script is: while read line do i=0 a[$i]=`grep "Host" |cut -d" " -f3 |tr -d ')'` echo ${a[$i]} i=`expr $i + 1` done < File Name Am trying to get the value of host and assign it to an array My O/p is 192.168.2.2 192.168.2.4 But i need the o/p to be: a[0]=192.168.2.2 a[1]=192.168.2.4 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|