Shell脚本如何换行
tes.txt格式如下,如何换行100034,0
100056,2
100047,4
100021,0
----------------
#!/bin/bash
echo $(cat tes.txt|awk -F ',' '{print $2;}')
没有得到换行,输出这个结果
0 2 4 0,我想得到
0
2
4
0
应该怎么改? [b]回复 [url=http://bbs.bathome.net/redirect.php?goto=findpost&pid=228262&ptid=55442]1#[/url] [i]netdzb[/i] [/b][code]echo "$(awk -F ',' '{print $2;}' tes.txt)"[/code][code]awk -F ',' '{print $2;}' tes.txt[/code] [code]cut -d',' -f2 tes.txt[/code]
页:
[1]