Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2071736
  • 博文数量: 470
  • 博客积分: 10206
  • 博客等级: 上将
  • 技术积分: 5620
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-03 12:50
文章分类

全部博文(470)

文章存档

2012年(1)

2011年(18)

2010年(47)

2009年(404)

分类:

2009-04-19 16:00:12

[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]#

阅读(1332) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~