限られたテキスト幅で表示する必要のある長い文字列が与えられた場合、各行が特定のテキスト幅以下の単一行の文字列を複数行の文字列に変換する* nixのコマンドラインツールはありますか? たとえば、次の文字列が与えられた場合 $ MYSTRING="Call me Ishmael. Some years ago - never mind how long precisely - having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world." 私はこのような形式にしたいと思います: …
ファイルから奇数行と偶数行を印刷したい。 エコーを利用するこのシェルスクリプトを見つけました。 #!/bin/bash # Write a shell script that, given a file name as the argument will write # the even numbered line to a file with name evenfile and odd numbered lines # in a text file called oddfile. # ------------------------------------------------------------------------- # Copyright (c) 2001 nixCraft project <http://cyberciti.biz/fb/> # …
テキストファイルがあります。 a aa aaa b bb bbb c cc ccc d dd ddd e ee eee f ff fff g gg ggg h hh hhh i ii iii j jj jjj どうすれば処理でき、次のような2列のファイルを取得できますか? a aa aaa b bb bbb c cc ccc d dd ddd e ee eee f ff fff …