标题: How to store multi-line output into an array in ksh93 [打印本页] 作者: wawxdyy 时间: 2010-10-28 15:41 标题: How to store multi-line output into an array in ksh93 Sorry, input method doesn't work, the following method doesn't work for me
root@solaris:~# testarray=( $(find .) )
root@solaris:~# echo ${testarry[@]}
root@solaris:~#
复制代码
作者: wawxdyy 时间: 2010-10-28 15:44
Never mind, it works actually. 作者: o绝对新手o 时间: 2010-10-28 15:56 回复 1#wawxdyy
你这是bash的写法,KSH应该这样
set -A arrary $(find .) 作者: wawxdyy 时间: 2010-10-28 16:08
Another question, when there are multiple columns in the output, how to get each whole line assigned to array element rather than each word. 作者: wawxdyy 时间: 2010-10-28 16:11 回复 3#o绝对新手o
yes, you are right, thanks. 作者: o绝对新手o 时间: 2010-10-28 16:25 回复 4#wawxdyy