# $Paefchen: home/as/.csh/_load.csh,v 1.1 2008/01/07 06:03:02 as Exp $
umask 22
alias whan 'if ($?CSHRC_DEBUG && $?prompt) echo CSHRC: \!:1'
alias aliass 'if ( -f \!:2 ) alias \!:1 source "\!:2"'
alias cshrc_md_opt 'grep -Eo "^# ?CSHRC_\!:2:au\: ?.+" < \!:1 | tail -1 | sed -E "s/^# ?CSHRC_\!:2:au\: ?(.*)/\1/"'
alias append_path 'if ( $\!:1 !~ \!:2\:* && $\!:1 !~ *\:\!:2\:* && $\!:1 !~ *\:\!:2 && $\!:1 !~ \!:2 ) setenv \!:1 ${\!:1}\:\!:2'
# add to front of path
alias prepend_path 'if ( $\!:1 !~ \!:2\:* && $\!:1 !~ *\:\!:2\:* && $\!:1 !~ *\:\!:2 && $\!:1 !~ \!:2 ) setenv \!:1 \!:2\:${\!:1}; if ( $\!:1 !~ \!:2\:* ) setenv \!:1 \!:2`echo \:${\!:1} | /usr/bin/sed -e s%^\!:2\:%% -e s%:\!:2\:%:%g -e s%:\!:2\$%%`'
switch ($OSTYPE:al)
case darwin:
alias cp_remote_file 'curl \!:1 > \!:2'
breaksw
case freebsd:
alias cp_remote_file 'fetch -o \!:2 \!:1'
alias rcdgetconfigarg ~/.csh/rcdgetconfigarg.sh
breaksw
default:
alias cp_remote_file 'fetch -o \!:2 \!:1'
endsw
if (! $?CSHRC_MD) set CSHRC_MD
foreach _md ($CSHRC_MD)
set _load_v = "CSHRC_MD_""$_md:au""_LAODED"
if (`eval 'if ($'"?$_load_v) echo 1"` == 1) continue
set _file = "${HOME}/.csh/${_md}.csh"
if (! -f "$_file") then
whan "Fehler: '$_md' konnte nicht gefunden werden."
continue
endif
if (! $?tcsh && `cshrc_md_opt $_file tcshonly` == "YES" ) continue
if (! $?prompt && `cshrc_md_opt $_file promptonly` == "YES") continue
set _osonly = `cshrc_md_opt "$_file" osonly`
if ("$_osonly" != "") then
set _status = 0
foreach _os ($_osonly:al)
if ($_os == $OSTYPE:al) set _status = 1
end
if ($_status == 0) continue
endif
whan "'$_md' wird geladen"
source "$_file"
eval set "$_load_v"
end
unset _md _file _status _load_v