Re: ksh script w/o perl

From: Bob.Kelley@BRINKSINC.COM
Date: Thu Jan 29 2004 - 16:35:47 EST


for those who want to do the same use an array, it seems to be easiest

cat /etc/oratab|grep apps|grep -v "#"|grep -v N|cut -c -8 |
{
let db_counter=1
while read dbname;
do
        export dbnames[$db_counter]=$dbname
        echo ${dbnames[$db_counter]}
        let db_counter="$db_counter + 1"
done
}

Bobby Kelley Jr.
972-877-5341

|---------+---------------------------->
| | Bob Kelley |
| | |
| | 01/29/2004 02:44 |
| | PM |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------------------------------------------|
  | |
  | To: aix-l@Princeton.EDU |
  | cc: |
  | 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

NOTICE TO BRINK'S EMPLOYEES:
All electronic mail communications composed, sent, received or stored on or
through Brink's equipment are subject to the Brink's Electronic
Communications Policy. Employees should have no expectation of privacy in
their use of the Company's electronic mail system.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:33 EDT