Google
 

« 日本語コードの変換 | メイン | phpMyAdminの設置(phpmyadmin 2.9.1.1) »

2007年04月26日

●Colorize the Prompt

コマンドプロンプトをカラー化。ユーザーによって差別化する。

cat > /etc/profile.d/colormyprompt.sh << "EOF"
#!/bin/sh
lc='[e[1;'
RED=${lc}31m;
PURPLE=${lc}35m
RC=${lc}0m

if [ "$USER" = "root" ]
then
pc=$RED
else
pc=$PURPLE
fi

PS1="${pc}]u@h W\$ ${RC}]"

EOF

chmod +x /etc/profile.d/colormyprompt.sh
/etc/profile.d/colormyprompt.sh

トラックバックURL

このエントリーのトラックバックURL:
http://www.fatcat-hosting.net/mt-tb.cgi/10