我解析文件以获取选定的字符串并构建到一行,但是,我不知道如何在shell脚本中执行该操作(如// add ...所示)如何追加字符串
while read line
do
tt=`echo $line | cut -d'|' -f2 | cut -d'"' -f1`
//add a $total = add all tt parts into a big string seperate by ", "
done < tmp_file
echo $total >> outfile
谢谢
只是附和什么在'tt'(加逗号)输出? – nhahtdh
我需要为每个文件构建一行($ total),并且该行由许多$ tt作成 –
可以不用' echo'。只是我的想法会招致相当多的磁盘访问。 – nhahtdh