【サーバ運用】ファイルサーバのrootのhistoryが取れてない!(2) .tcshrcを弄くれ!

はい、続きです。
前回の日記でスクリプトを直接実行するのはよろしくないという
結果に行き着いたので、今回は.tcshrcを弄くってbash風に
一元管理させるように変更してみます。
まずはtcshrcを開いて……

# jove /root/.tcshrc

history関連を以下のように書き換え。
――中略――
## Command history settings
#
set histfile=~/.tcsh_history
set history=500
set savehist=500
set histdup=erase

# merge history files
#
if ( -d /usr/bin/ ) then
touch /tmp/roottcshhistory$$ ${histfile}
chmod 600 /tmp/roottcshhistory$$ ${histfile}
cat ~/.history* | paste - - | sort | uniq -f 1 | \
awk '{print $1 "\n" substr($0, 14, length($0) - 13)}' | \
tail -n ${history} \
> /tmp/roottcshhistory$$
mv /tmp/roottcshhistory$$ ${histfile}
endif

ここまで出来たらセーブしてエディタを抜け、
ログアウト>ログインとやって新たに.tcsh_historyが
/root/に出来るかを確認します。

xxx /root# logout
user$ su
Password:
xxx /root# ls -la
total 104
drwxr-xr-x 4 root wheel 512 Nov 1 23:08 .
drwxr-xr-x 22 root wheel 512 Oct 6 04:46 ..
-rw-rw-rw- 1 root wheel 1637 Feb 17 2006 .bash_history
-rw-r--r-- 2 root wheel 803 Jan 10 2006 .cshrc
-rw-r--r-- 1 root wheel 143 Nov 11 2004 .k5login
-rw-r--r-- 1 root wheel 293 Nov 11 2004 .login
-rw