▼すべてを開く。
▲すべてを閉じる。
$ cat desc.txt The tr command replace each input sequence of a repeated character with a single occurence of that character.
$ tr -s ' ' < desc.txt The tr command replace each input sequence of a repeated character with a single occurence of that character.
trコマンドで-sオプション、重複する文字「' '」、リダイレクト「<」でファイル「desc.txt」をtrコマンドに与えると、スペースの重複を一つのスペースに変換する。
$ cat desc.txt The tr command replace each input sequence of a repeatted character with a single occurence of that character.
$ tr -s 't' < desc.txt The tr command replace each input sequence of a repeated character with a single occurence of that character.
trコマンドで-sオプション、重複する文字「't'」、リダイレクト「<」でファイル「desc.txt」をtrコマンドに与えると、2行目の単語「repeatted」の文字「t」の重複を削除する。