[root@Greendays lianshou]# awk -F : '!a[$1]++{print $1}' test
aaaa
pppp
oooo
ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}'
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print "\n"}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print }' test
aaaa, pppp, oooo, ssssssss:pppppp
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print }' test
aaaa, pppp, oooo, ssssssss:pppppp
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}' test
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}' test
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{printf "\n"}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{printf "\n"}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{printf "\n"}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR!=1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{print $1}' test
aaaa
pppp
oooo
ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{print $1}' test
aaaa
pppp
oooo
ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR>1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR>1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR>1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR>1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F : '!a[$1]++{if(NR>1) printf ", ";printf "%s", $1}END{print ""}' test
aaaa, pppp, oooo, ssss
[root@Greendays lianshou]# awk -F: '!a[$1]++{if(NR>1) printf ",";printf $1}END{print ""}' test
aaaa,pppp,oooo,ssss
[root@Greendays lianshou]# awk -F: '!a[$1]++{if(NR>1) printf ",";printf $1}END{print ""}' test
aaaa,pppp,oooo,ssss
[root@Greendays lianshou]# awk -F: '!a[$1]++{if(NR>1) printf ",";printf $1}END{print ""}' test
aaaa,pppp,oooo,ssss
[root@Greendays lianshou]# awk -F: '!a[$1]++{if(NR>1) printf ",";printf $1}END{print ""}' test
aaaa,pppp,oooo,ssss
[root@Greendays lianshou]# awk -F: '!a[$1]++{if(NR>1) printf ",";printf $1}END{print ""}' test
aaaa,pppp,oooo,ssss
[root@Greendays lianshou]#
阅读(565) | 评论(0) | 转发(0) |