From: Libor Laubacher (llaubach@PROGRESS.COM)
Date: Thu Jan 29 2004 - 16:29:48 EST
No sure, if this is what are you looking for
count=1
for i in `cat /etc/oratab|grep -v "#"|grep -v N|cut -c -8`
do
xx=DB$count=$i
export $xx
count=`expr $count + 1`
done
dcho $DB1 $DB2
/Libor
-----Original Message-----
From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of
Bob.Kelley@BRINKSINC.COM
Sent: Thursday, January 29, 2004 9:44 PM
To: aix-l@Princeton.EDU
Subject: ksh script w/o perl
Anybody have a quick way to set each line of output from a file to a
different variable without using perl?
Eg
[root@nad0019aixd05/home..oracle]# cat /etc/oratab|grep -v "#"|grep -v
N|cut -c -8
PRODUCES two lines:
clipsdv1
cashsqa1
how can I painlessly set these in a script to variables DB1 and DB2?
Bobby Kelley Jr.
972-877-5341
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:33 EDT