タブで区切られた列を持つログ ファイルを生成したいと考えています。コメント フィールドを除くすべてのタブで区切られた出力を含む次の形式にする必要があります。
time date alias comment
10:09:20 03/06/13 jre This is a test comment
歴史的な目的で csh を使用しています
set time = `perl -MPOSIX -e 'print POSIX::strftime("%T", localtime)'`
set date = `perl -MPOSIX -e 'print POSIX::strftime("%d/%m/%y", localtime)'`
set alias = jre
set comment = "This is a test comment"
テキストをパイプする column -t
echo "time\tdate\talias\tcomment" | column -t > somefile
echo "$time\t$date\t$alias\t$comment" | column -t >> tt
欲しいものはほぼ手に入る。ただし、コメント フィールドのスペースもタブに変更されます。最初の 3 つのフィールドをタブで区切って、コメント フィールドのスペース区切りを維持する方法はありますか?