rm -rf xyz.log echo "Enter n" read n x[0]=ABC x[1]=DEF ... You're missing quotes in the last line: o=`cat ...
stackoverflow.com