Next time, we'll take a look at uniq.
下次,我们将讨论uniq。
uniq reduces the list to the following
uniq 可将列表精简为
Both sort and uniq print outcomes to stdout.
sort和uniq都将输出打印到stdout。
The uniq command can also ignore some fields.
uniq命令还可以忽略某些字段。
Again, note how Perl was an intermediate tool between find, sort and uniq.
此外,请注意Perl是如何成为find、sort和uniq之间的中间工具的。
Finally, sort and uniq in sequence ensure that repeated album names will be printed only once.
最后,按顺序的sort和uniq确保了重复的专辑名只打印一次。
For the immediate problem, yes, shell is better; it makes good use of the built-in uniq -c command.
在目前这个问题上,我们承认,Shell的表现更为出色;它很好地利用了内置的uniq- c命令。
However, both sort and uniq require data entry or input from the standard input device (stdin).
但是sort和uniq则需要从标准输入设备(stdin)请求数据输入。
Our sort was by collating sequence, so uniq gives us the "10 apple" line instead of the "1 apple".
我们的排序是按照字符序列进行的,因此uniq 显示的是 “10apple”行,而不是 “1 apple”。
The stdout of find becomes the stdin of uniq; in turn, the stdout of uniq becomes the stdin for sort.
find命令的stdout成为uniqstdin,然后uniq的stdout又成为sort的stdin。
If necessary, you can extend the pipeline shown above further and redirect the output of uniq to yet another utility.
如有需要,您可进一步扩展管道,将uniq的输出重定向到另外的实用工具。
To learn more about the extensive features of find, sort, and uniq, refer to each utility's man page on your UNIX system.
要了解find、sort和uniq的更多扩展特性,请参阅您的UNIX系统中每种实用工具的man页。
Then, use awk to strip out the command name minus options and arguments, and pass the sorted list to uniq to give an enumerated list.
然后,使用awk删除命令名称减号选项和参数,然后将经过排序的列表传递给uniq以得到一个枚举列表。
The uniq command normally operates on sorted files, and removes consecutive identical lines from any file, whether sorted or not.
uniq命令通常操作已排序的文件,并从文件(不管是否排序)中删除连续的相同行。
The Uniq function is declared to take a range, so it will only be called once, even when invoked on a range of lines in the buffer.
Uniq函数被声明为接受一个范围,因此只能调用一次,即使在缓冲区内的一个行范围上调用时。
All the find, sort and uniq invocations could have been done with Perl, but why bother when the operating system already has those written for us?
所有的find、sort和uniq调用都可以用Perl完成,但是在操作系统已经为我们编写了这一切时为何还烦恼呢?
Uniq (pronounced "unique") scans a list, comparing adjacent elements in the list and removing any duplicates. For instance, suppose you have this list.
uniq(读做“unique”),扫描列表,比较列表中的相邻元素,以去除任何重复项。
Therefore, the output of the entire script is piped through sort, and then uniq to yield an alphabetized list of unique commands found in your $PATH.
因此,整个脚本的输出通过sort、然后通过 uniq 进行管道传输,以产生在您的 $PATH 中找到的唯一命令的字母排序列表。
However, if the original list of Marx Brothers is sorted first (reordering all occurrences of a name into a continuous run), running uniq yields this result.
但是,如果首先对MarxBrothers的初始列表进行排序(在连续运行中对多次出现的名称进行重排),运行uniq会生成以下结果。
However, if the original list of Marx Brothers is sorted first (reordering all occurrences of a name into a continuous run), running uniq yields this result.
但是,如果首先对MarxBrothers的初始列表进行排序(在连续运行中对多次出现的名称进行重排),运行uniq会生成以下结果。
应用推荐