|
发表于 2007-6-9 08:28:21
|
显示全部楼层
第一个问题可以分成几步来理解(unix):
1. display all entries (cat, sed, awk, etc) to do the display
2. filter - not blank, not "#". (sed, awk) should do.
3. sort - alpha, no dup (sort)
4. redirect.
所以,我们可以做下面的命令:- sed -n '/^$\|^#/!p' | sort -u > /tmp/shortedlines
复制代码
2. just a little complex sort command. You can take a look the sort manpage. |
|