由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - self test: awk question
相关主题
Unix/Linux 命令行如何去除文本的重复行Damn this is pretty.
请麻烦推荐好的 Weblog analyzer tools (offline).how big is your swap?
万佛,请推荐word frequency tool? (转载)about time command in linux
讨论:linux终端下的表格数据处理?KDE 是好吃猪。。。
any body help me about these sentence in the shell script?bash script真难看懂
关于server的/var/www/usage目录how to check disk usage per user?
求助:bash里面break 和exit命令不能提前终止循环我还有个问题
有没有什么cpu/memory usage画图软件ubuntu 10.10 ibus CPU usage 100%的看过来
相关话题的讨论汇总
话题: awk话题: question话题: ncc话题: self话题: test
进入Linux版参与讨论
1 (共1页)
c****j
发帖数: 258
1
someone asked me to explain this awk usage, it looks like an interesting
question, and potentially useful for some rare case, so I post it here.
echo -e "aa\nbb\ncc\naa\ncc" | awk \!'x[$0]++'
enjoy!
c****j
发帖数: 258
2
this is used to remove duplicate lines, I think the one who wrote this is
just trying to confuse his readers, it can be written as
awk '!x[$0]'
it's better than sort/uniq coz it preserve the original order. you can
remove the ! to check what is duplicated.
1 (共1页)
进入Linux版参与讨论
相关主题
ubuntu 10.10 ibus CPU usage 100%的看过来any body help me about these sentence in the shell script?
kde vs gnome关于server的/var/www/usage目录
大家Linux装32bit还是64bit?求助:bash里面break 和exit命令不能提前终止循环
Why this message -- it is already 13.04 and still ask to upgrade有没有什么cpu/memory usage画图软件
Unix/Linux 命令行如何去除文本的重复行Damn this is pretty.
请麻烦推荐好的 Weblog analyzer tools (offline).how big is your swap?
万佛,请推荐word frequency tool? (转载)about time command in linux
讨论:linux终端下的表格数据处理?KDE 是好吃猪。。。
相关话题的讨论汇总
话题: awk话题: question话题: ncc话题: self话题: test