[ungesichtete Version][ungesichtete Version]
Inhalt gelöscht Inhalt hinzugefügt
Sycarr (Diskussion | Beiträge)
Unixguy (Diskussion | Beiträge)
Example: clarify grep '[a-z]' to remove double negative (inludes lines with lowercase letters, excludes blank lines)
Zeile 16:
*Second, '''<tt>sed</tt>''' this expression removes all characters which are not spaces or letters from the web page's content, replacing them with spaces.
*Third, '''<tt>tr</tt>''' changes all of the uppercase letters into lowercase and converts the spaces in the lines of text to newlines (each 'word' is now on a separate line).
*Fourth, '''<tt>grep</tt>''' removesincludes only lines that doesn't contain anat least one lowercase [[alphabetical]] character (removing any blank lines).
*Fifth, '''<tt>sort</tt>''' sorts the list of 'words' into alphabetical order, and the <tt>-u</tt> switch removes duplicates.
*Finally, '''<tt>comm</tt>''' finds lines in common between two files, <tt>-23</tt> suppresses lines unique to the second file, and those which are common to both, leaving only those which are found only in the first file named. The <tt>-</tt> in place of a filename causes <tt>comm</tt> to use its standard input (from the pipe line in this case). This results in a list of "words" (lines) which are not found in /usr/dict/words.