RE: Newbie Korn shell script question

From: Ed Skolnik (eskolnik@interpublic.com)
Date: Tue Feb 04 2003 - 12:41:10 EST


Thanks to all that helped, but changing the "RC$I=0" to "eval RC$I=0"
did the trick, I didn't need to ise the "eval" with the "export RC$I"
which is weird to me. Thanks to all that helped.

Ed Skolnik
The Interpublic Group Of Companies, Inc.
Shared Services Chicago System Administrator
676 North St. Clair Street
Chicago, Illinois 60611
Phone: 312-425-6554
Fax: 312-425-6924
e-mail: eskolnik@Interpublic.com

-----Original Message-----
From: James Zhao [mailto:james@bdc.cv.net]
Sent: Tuesday, February 04, 2003 11:21 AM
To: Ed Skolnik
Subject: RE: Newbie Korn shell script question

you have to use:

eval RC$I=0;

otherwise, the script treats "RC$I=0" as a command and that's why you
got a "not found"

James Zhao
Email: james@bdc.cv.net

-----Original Message-----
From: sunmanagers-admin@sunmanagers.org
[mailto:sunmanagers-admin@sunmanagers.org]On Behalf Of Ed Skolnik
Sent: Tuesday, February 04, 2003 12:04 PM
To: sunmanagers@sunmanagers.org
Subject: Newbie Korn shell script question

I am having a problem with the following peice of a ksh script and
don't understand why I get errors saying RC0 (RC$I) not found.

$ cat s
MAX=2
I=0
while true; do
 I=$(expr $I + 1)
   echo $I
     RC$I=0;export RC$I
       if [[ "$I" = "$MAX" ]] ; then
           echo exit
               break
fi
done

 :
+ + expr 0 + 1
I=1
+ echo 1
1
+ RC1=0
s[6]: RC1=0: not found
+ export RC1
+ [[ 1 = 2 ]]
+ :
+ + expr 1 + 1
I=2
+ echo 2
2
+ RC2=0
s[6]: RC2=0: not found
+ export RC2
+ [[ 2 = 2 ]]
+ echo exit
exit
+ break

Ed Skolnik
The Interpublic Group Of Companies, Inc.
Shared Services Chicago System Administrator
676 North St. Clair Street
Chicago, Illinois 60611
Phone: 312-425-6554
Fax: 312-425-6924
e-mail: eskolnik@Interpublic.com

[demime 0.99c.7 removed an attachment of type application/ms-tnef which
had a name of winmail.dat]
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:46 EDT