while read row do
echo "<tr>" >> $file
for valore in $row
do
echo "<td>$valore</td>" >> $file
done
echo "</tr>" >> $file
done < alunni.txt
echo "</table>" >> $file
当我执行这段代码时,它给出了这个错误:
./table_html.csv: line 36: syntax error near unexpected token `echo'
./table_html.csv: line 36: ` echo "<td>$valore</td>" >> $file'
我该怎么补救?
我不太擅长shell脚本,这就是为什么我想不出别的。
1条答案
按热度按时间qrjkbowd1#
(Ah当烤箱的闹钟响的时候,我正在做这个。我想说的是,这只是“do”在错误的地方,所以这里是你的代码重述(添加了一个file=“filename”来让它工作):
所以这只是一个换行符之前,做是所有你需要的:-)