您也可以使用結束程序檔來自訂已經安裝在系統上的檔案。 例如,透過將資訊附加到 root (/) 目錄中的 .cshrc 檔案,範例 24–4 中的結束程序檔就可以自訂根環境。
#!/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 } |