tam=$(cat $1|wc -l ) echo "double golden["${tam}"][4]={" #for i in $1 do # echo "{"${i}"}" #done sep= while IFS= read -r line do ## take some action on $line echo $sep"{$line}" sep=, done < $1 echo "};"