Você só quer gerar 85 linhas de código?
for a in {1..85}
do
echo "user_dept$a=\$( while read -r x && read -r y <&3; do echo \" model: \$model_$a user: \$x department: \$y License_Used: \$p_out$a\"; done < /home/user_files/out$a.txt 3</home/dept_files/dep$a.txt | ts '%Y-%m-%d %H:%M:%S')"
done > resulting_code
O truque é garantir que as citações sejam observadas. Portanto, os caracteres $
e "
"precisam ser citados como \$
e \"
As primeiras 3 linhas da saída resultante:
user_dept1=$( while read -r x && read -r y <&3; do echo " model: $model_1 user: $x department: $y License_Used: $p_out1"; done < /home/user_files/out1.txt 3</home/dept_files/dep1.txt | ts '%Y-%m-%d %H:%M:%S')
user_dept2=$( while read -r x && read -r y <&3; do echo " model: $model_2 user: $x department: $y License_Used: $p_out2"; done < /home/user_files/out2.txt 3</home/dept_files/dep2.txt | ts '%Y-%m-%d %H:%M:%S')
user_dept3=$( while read -r x && read -r y <&3; do echo " model: $model_3 user: $x department: $y License_Used: $p_out3"; done < /home/user_files/out3.txt 3</home/dept_files/dep3.txt | ts '%Y-%m-%d %H:%M:%S')