It is currently Mon, 27 Jun 2022 13:08:22 GMT



 
Author Message
 Export with variable variable-names?
Hi folks,

my problem in a Korn Shell is as foolows:

I want to export a number of variables which
are to be handled by a Tcl script. Therefor,
I cannot export an array. As I do not know
in advance how many variables there are to
be exported I use varibles. Look at the example:

1 count=1
2 for ID in $LISTE
3   tmp=`awk something`
4    export TOOL${count}=${tmp}
5   count=$((count+1))
6 done

If  I do this then the error message
     scriptname[4] .... is not an identifier
occurs.

Any help is highly appreciated,

Thanks in advance,
Thomas



 Sat, 05 May 2001 03:00:00 GMT   
 Export with variable variable-names?
Hi folks,

my problem in a Korn Shell is as foolows:

I want to export a number of variables which
are to be handled by a Tcl script. Therefor,
I cannot export an array. As I do not know
in advance how many variables there are to
be exported I use varibles. Look at the example:

1 count=1
2 for ID in $LISTE
3   tmp=`awk something`
4    export TOOL${count}=${tmp}
5   count=$((count+1))
6 done

If  I do this then the error message
     scriptname[4] .... is not an identifier
occurs.

Any help is highly appreciated,

Thanks in advance,
Thomas



 Sat, 05 May 2001 03:00:00 GMT   
 Export with variable variable-names?

Thomas,
    You dont have a "do statement" ie

1 count=1
2 for ID in $LISTE;do
3   tmp=`awk something`
4    export TOOL${count}=${tmp}
5   count=$((count+1))
6 done

hth,
    duncan



 Sat, 05 May 2001 03:00:00 GMT   
 Export with variable variable-names?
Well, in the end I found the reason.
The do statement is missing as Duncan
hinted at, but I only forgot to post this.
The problem arose by not masquerading
the right hand side of  the statement. As it
occured some special signs as e.g. "|", the
shell interpreted these and ran inro errors.

Sorry for causing inconvenience,

Thomas



 Sat, 05 May 2001 03:00:00 GMT   
 
   [ 4 post ] 

Similar Threads

1. Variable substitution within a variable name

2. Create variable named variable$i in for loop

3. Using a variable in a variable name in KSH

4. Value of a variable of which the name is in another variable

5. variable variable names

6. Q: Variable name within a variable

7. Variable variable names is csh

8. Q: Variable variable names in sh

9. Needed: a variable who's name is controlled by a variable

10. Evaluating variable names stored in variables


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software