Annotation of home/as/.csh/reload.csh, revision 1.1
1.1 ! as 1: # $Paefchen$
! 2:
! 3: # CSHRC_RELOAD: NO
! 4: # CSHRC_ROMPTONLY: YES
! 5:
! 6: if ("`alias reload`" == "") then
! 7: aliass reload ~/.csh/reload.csh
! 8: else
! 9: if ($# < 1) then
! 10:
! 11: if ($?tcsh) then
! 12: set _shells = 'CSH TCSH'
! 13: printf " %-12s %-6s %-s\n" NAME SHELL BESCHREIBUNG
! 14: else
! 15: set _shells = 'CSH'
! 16: printf " %-12s %-s\n" NAME BESCHREIBUNG
! 17: endif
! 18:
! 19: foreach _shell ($_shells)
! 20: foreach _prompt (_ _PROMPT_)
! 21: set _list = `eval echo '$'"AS_CSHRC_${_shell}${_prompt}FILES"`
! 22: foreach _script ($_list)
! 23: set _script = "${HOME}/.csh/$_script.$_shell:al"
! 24: if (! -f $_script) continue
! 25: set _yes = `\
! 26: awk -F '[:]*' '/# *AS_CSHRC_RELAOD:/ {print $2}' < "$_script" |\
! 27: sed 's/ //g'`
! 28: if ($_yes:al != 'yes') continue
! 29: set _descr = `awk -F '[:]*' '/# *AS_CSHRC_RELAOD_DESCR:/ {print $2}' < "$_script"`
! 30: if ($?tcsh) then
! 31: printf "%-12s %-6s %-s\n" $_script:t:r $_shell:al "$_descr"
! 32: else
! 33: printf "%-12s %-s\n" $_script:t:r "$_descr"
! 34: endif
! 35: end
! 36: end
! 37: end
! 38: unset _shells _shell _prompt _list _script _yes _descr
! 39:
! 40: else if ($1 == '--help') then
! 41: echo "Hilfe: reload [<skript>[.<shell>]]"
! 42:
! 43: else
! 44: set _script = "${HOME}/.csh/"`echo $1 | awk -F '[.]*' '{print $1}'`
! 45: set _shell = `echo $1 | awk -F '[.]*' '{print $2}'`
! 46: if ($_shell == "") then
! 47: if (-f $_script.csh) then
! 48: set _script = $_script.csh
! 49: else if (-f $_script.tcsh) then
! 50: set _script = $_script.tcsh
! 51: else
! 52: echo "Fehler: $1 konnte keine zugehoerige Shell finden."
! 53: set _error
! 54: endif
! 55: else
! 56: set _script = $_script.$_shell
! 57: if (! -f $_script) then
! 58: echo "Fehler: $_script:t konnte nicht gefunden werden."
! 59: set _error
! 60: endif
! 61: endif
! 62:
! 63: if (! $?_error) then
! 64: source $_script
! 65: endif
! 66:
! 67: unset _script _shell _error
! 68:
! 69: endif
! 70: endif