1 | # Prototype file for setting up course-specific environment |
---|
2 | # $Author: cfields $ |
---|
3 | # $Source: /afs/dev.mit.edu/source/repository/packs/dotfiles/env_setup,v $ |
---|
4 | # $Header: /afs/dev.mit.edu/source/repository/packs/dotfiles/env_setup,v 1.5 1995-05-27 20:52:31 cfields Exp $ |
---|
5 | |
---|
6 | # Just in case this alias is not already set, |
---|
7 | alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\ |
---|
8 | if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\ |
---|
9 | if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\ |
---|
10 | unset extendyes' |
---|
11 | |
---|
12 | echo "Attaching $SUBJECT ... " |
---|
13 | set setup_dir = `/bin/athena/attach -p $SUBJECT` |
---|
14 | |
---|
15 | if (! $status) then |
---|
16 | |
---|
17 | # Record information to remove setup later |
---|
18 | set setup_filsys = $SUBJECT |
---|
19 | |
---|
20 | # Set prompt to reflect changed environment |
---|
21 | set prompt = "$SUBJECT% " |
---|
22 | |
---|
23 | if ( -r $setup_dir/.attachrc) then |
---|
24 | unsetenv SUBJECT # to prevent infinite loops |
---|
25 | echo "Running commands in $setup_dir/.attachrc ... " |
---|
26 | source $setup_dir/.attachrc |
---|
27 | else |
---|
28 | # Do minimal environment setup |
---|
29 | extend PATH $setup_dir/${bindir} |
---|
30 | extend MANPATH $setup_dir/man |
---|
31 | endif |
---|
32 | else |
---|
33 | echo "" |
---|
34 | echo "The $SUBJECT filesystem could not be attached." |
---|
35 | set filsys = `hesinfo $SUBJECT filsys` |
---|
36 | if ($#filsys < 3) then |
---|
37 | echo "Check your spelling of the filesystem name." |
---|
38 | else |
---|
39 | echo -n "The $filsys[1] fileserver" |
---|
40 | if ($filsys[1] != AFS) echo -n " named $filsys[3]" |
---|
41 | echo " may be down." |
---|
42 | endif |
---|
43 | if ($?XSESSION) then |
---|
44 | echo "Type exit to get rid of this window." |
---|
45 | else |
---|
46 | kill -HUP $$ # cause shell to exit |
---|
47 | endif |
---|
48 | endif |
---|
49 | unsetenv SUBJECT # to prevent infinite loops |
---|