开发者

counting in awk

#!/bin/sh
find $开发者_如何学Go{*-.} -type f -print | xargs file | 
awk '{
$1=NULL;
t[$0]++;
}
end {
for (i in t) printf("%d\t%s\n", t[i], i);
}' | sort -nr

The first "find" line works. But the awk part does not work. I expect the count of file types sorted in descending order.


awk is case sensitive - "end" should be "END"


Use END, not end.


Try to add a blank between the tick and the {:

awk ' {

Some versions of AWK need this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜