Hi there,
I need to export a variable that is an array. I didn't find a way til now and it seems to me that arrays are strictly not exportable. Am I right or too stupid?
The ksh man page doesn't mention it.
Sample script (test.sh):
#!/usr/bin/ksh
echo "\$ARRAY: $ARRAY" # the whole thing
echo "\${ARRAY[0]}: ${ARRAY[0]}" # the first element
Command Line Input:
$set -A ARRAY first second
$export ARRAY
$echo $ARRAY
first second
$./test.sh
$
Furthermore inside the above script ARRAY is empty.
Is there anybody out there who can explain that to me. What is the difference between an array and a normal environment variable (if there is such)?.
Any hints are appreciated.
I need to export a variable that is an array. I didn't find a way til now and it seems to me that arrays are strictly not exportable. Am I right or too stupid?
The ksh man page doesn't mention it.
Sample script (test.sh):
#!/usr/bin/ksh
echo "\$ARRAY: $ARRAY" # the whole thing
echo "\${ARRAY[0]}: ${ARRAY[0]}" # the first element
Command Line Input:
$set -A ARRAY first second
$export ARRAY
$echo $ARRAY
first second
$./test.sh
$
Furthermore inside the above script ARRAY is empty.
Is there anybody out there who can explain that to me. What is the difference between an array and a normal environment variable (if there is such)?.
Any hints are appreciated.