2014/09/01

shell - 立つハッカー、シェルを濁さず - Qiita

おことわり このTipsは不作法だとして異論が出るかもしれないが、私自身がよくやるのでここで公開してみる。それは一体何かというと…… コマンドヒストリーが残るのイヤだ! と思うことってよくないだろうか...

http://qiita.com/richmikan@github/items/2c90ddb778a7d4948324

man bash によると

HISTFILE
       The name of the file in which command history is saved (see HIS‐
       TORY below).  The default value is ~/.bash_history.   If  unset,
       the  command  history  is  not  saved  when an interactive shell
       exits.

HISTFILE を unset (HISTFILE=)したらヒストリは保存されないよと書いてある。

shell芸、嫌いではないけど、出来ればそういうのを tips として広めないで欲しい。kill -9 で殺してしまったら trap で後処理としてテンポラリファイルを消してる処理が走らなくなってしまうのではないですか?それって濁さないとは言わないのでは。

追記

Posted at 13:46 | WriteBacks () | Edit
Edit this entry...

wikieditish message: Ready to edit this entry.






















A quick preview will be rendered here when you click "Preview" button.