今天写cat文件,并将结果赋值到数组中时遇到个坑,while read line之后,我在do done之中进行数组赋值,最后打印发现数组为空,错误代码如下:
function testcat()
{
#读取文件
a=0
cat test | while read line
do
results[$a]=$line
((a
今天写cat文件,并将结果赋值到数组中时遇到个坑,while read line之后,我在do done之中进行数组赋值,最后打印发现数组为空,错误代码如下:
function testcat()
{
#读取文件
a=0
cat test | while read line
do
results[$a]=$line
((a