Re: ksh script w/o perl
From: Thierry ITTY (thierry.itty_at_BESANCON.ORG)
Date: 01/30/04
- Previous message: Bob.Kelley_at_BRINKSINC.COM: "Re: Flatpanel rackmount 1U serial terminal?"
- Maybe in reply to: Bob.Kelley_at_BRINKSINC.COM: "ksh script w/o perl"
- Next in thread: John Jolet: "Re: ksh script w/o perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 03:30:33 -0500 To: aix-l@Princeton.EDU
the following shell command line will set the variables YOURPREFIX1 to
YOURPREFIXnnn to the content of each line form YOURFILE from the 1st to the
nnnth
funny, isn't it ?
# your shell
...
$(awk '{print "eval export YOURPREFIX" NR "=\"" $1 "\""}' YOURFILE)
...
hth
A 08:22 30/01/2004 +0800, vous avez écrit :
>Bobby,
>
>cat /etc/oratab|grep -v "#"|grep -vN|cut -c -8|xargs echo|read DB1 DB2
>export DB1 DB2
>
>Jef...
>
>
>
>
>-----Original Message-----
>From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of
>Bob.Kelley@BRINKSINC.COM
>Sent: Friday, January 30, 2004 4:44 AM
>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
>
>
- * - * - * - * - * - * -
Bien sûr que je suis perfectionniste !
Mais ne pourrais-je pas l'être mieux ?
Thierry ITTY
eMail : Thierry.Itty@Besancon.org FRANCE
- Previous message: Bob.Kelley_at_BRINKSINC.COM: "Re: Flatpanel rackmount 1U serial terminal?"
- Maybe in reply to: Bob.Kelley_at_BRINKSINC.COM: "ksh script w/o perl"
- Next in thread: John Jolet: "Re: ksh script w/o perl"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]