Solaris 9 安裝指南

使用結束程序檔自訂根環境

您也可以使用結束程序檔來自訂已經安裝在系統上的檔案。 例如,範例 24–3 中的結束程序檔將資訊附加到根 (/) 目錄中的 .cshrc 檔案,以自訂根環境。


範例 24–3 使用結束程序檔自訂根環境

#!/bin/sh
#
# Customize root's environment
#
echo "***adding customizations in /.cshrc"
test -f a/.cshrc || {
cat>> a/.cshrc <<EOF
set history=100 savehist=200 filec ignoreeof prompt="\$user@`uname -n`> "
alias cp cp -i
alias mv mv -i
alias rm rm -i
alias ls ls -FC
alias h history
alias c clear
unset autologout
EOF
}