Write your scripts in a modern type-safe and runtime-safe programming language that handles many bugs and mistakes during compilation process.
Unix 哲学的に考えれば、行を並び替える sort コマンドと重複行を取り除く uniq コマンドは別のコマンドであるべきなように思えます。しかし sort コマンドには -u オプションとして uniq コマンドに相当する機能が組み込まれています。なぜそうなっている(そうなってしまった)のかを「ソフトウェア作法(さくほう)」を参照しながらこの記事で明らかにしたいと思います。 「誰」がuniq機能をsortコマンドに組み込んだ!? 熱烈的な Unix 哲学の信者は「どうせ Unix 哲学を理解しない GNU が便利だと思ってオプションを追加したのだろう」と考えるかもしれません。しかし uniq 機能が組み込まれたのは Version 7 Unix、つまり Unix の開発者が組み込んだのです。これは 1979 年の Version 7 Unix のドキュメントから明らかです。 sort:
Motivation Introduction User input strace Printing non-printable stty raw -echo -isig UTF-8 Conclusion Motivation This blog series explains how modern terminals and command-line tools work. The primary goal here is to learn by experimenting. I’ll provide Linux tools to debug every component mentioned in the discussion. Our focus is to discover how things work. For the explanation of why things wor
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く