in reply to Environment variable is an array

Just to add what others have said, on most shells (you don't say which shell, or version) if you export an array you only get the first element. I know that the Bash project was working on a method to do it, but I don't know if it was complete. You might ask on an AT&T mailing list here about the Korn shell.

Those shells which allow exporting of functions (export -f function_name) give interesting results, and it might be possible to embed the array in a function and export that - but you will have to unpack it in Perl and the format varies between shell versions.

Replies are listed 'Best First'.
Re^2: Environment variable is an array
by stevenswj (Initiate) on Oct 29, 2010 at 14:12 UTC
    Thanks for help, I'll just export a comma-separated string instead of a shell array then parse it.