Você precisa introduzir um arquivo para done
de while
, como:
done < myfile.txt
cmdline> ls -la /.myScript.sh
set index=0
set usrlist[index]="null"
while read line
do
#Total lines read
z='echo $line| wc -l'
lines='expr $lines + $z'
# 2) #total unique user
linesED='echo $line | sed 's/[0-9]//g''
linesEDA='echo ${linesED:10}'
userr='echo $linesEDA | awk '{print $1}''
for i in z
do
usrlist[i]=$userr
done
index='expr $index + $i'
echo ${usrlist[index]}# prints out data correctly but with
#error expr:non-integer argument
done
echo ${usrlist[index]}#here blank output only
Eu quero imprimir todos os memebers de array no final, sem erro
Tags bash shell-script