さて、テキストのブロックで、任意のファイルで最も頻繁に使用される100個の単語を一覧表示するコマンドを作成する必要があります。私が今持っているもの:
$ alias words='tr " " "\012" <hamlet.txt | sort -n | uniq -c | sort -r | head -n 10'
出力
$ words
14 the
14 of
8 to
7 and
5 To
5 The
5 And
5 a
4 we
4 that
次の形式で出力する必要があります。
the of to and To The And a we that
((その点で、出力をすべて大文字で印刷するように指示するにはどうすればよいですか?))
また、「単語」を任意のファイルにパイプできるように変更する必要があるため、パイプ内でファイルを指定する代わりに、最初の入力でファイルに名前を付け、残りはパイプで行います。