ksh: assigning function output to an array
Posted
by rcarson
on Stack Overflow
See other posts from Stack Overflow
or by rcarson
Published on 2010-03-20T00:16:09Z
Indexed on
2010/03/20
0:21 UTC
Read the original article
Hit count: 814
Why doesn't this work???
#!/bin/ksh
# array testfunc()
function testfunc {
typeset -A env
env=( one="motherload" )
print -r $env
return 0
}
testfunc # returns: ( one=motherload )
typeset -A testvar # segfaults on linux, memfaults on solaris
testvar=$(testfunc) # segfaults on linux, memfaults on solaris
print -r $testvar
I am sure this has been asked before, but I am not sure what to search on and everything I have been trying to use for keywords is not bringing me any answers that relate to my problem.
© Stack Overflow or respective owner