Newbie Korn shell script question

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


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



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