shell循环拼接字符串

思路:将字符串重定向追加到文件中,再获取出来

 

echo 'string11111111' >> replay_html.log

 #读取文件每一行

while read line
do
echo "string22222222" >> replay_html.log
echo $line >> replay_html.log
echo "string3333333333" >> replay_html.log
done < $1

echo "string end" >> replay_html.log

file_html=`cat replay_html.log`

posted on 2021-03-29 19:47  该用户很懒  阅读(2141)  评论(0编辑  收藏  举报