source: trunk/packs/dotfiles/env_setup @ 12451

Revision 12451, 1.4 KB checked in by ghudson, 26 years ago (diff)
Normalize RCS IDs somewhat.
Line 
1# Prototype file for setting up course-specific environment
2# $Id: env_setup,v 1.6 1999-02-04 17:49:00 ghudson Exp $
3
4# Just in case this alias is not already set,
5alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
6        if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
7        if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\
8        unset extendyes'
9
10echo "Attaching $SUBJECT ... "
11set setup_dir = `/bin/athena/attach -p $SUBJECT`
12
13if (! $status) then
14
15        # Record information to remove setup later
16        set setup_filsys = $SUBJECT
17
18        # Set prompt to reflect changed environment
19        set prompt = "$SUBJECT% "
20
21        if ( -r $setup_dir/.attachrc) then
22                unsetenv SUBJECT        # to prevent infinite loops
23                echo "Running commands in $setup_dir/.attachrc ... "
24                source $setup_dir/.attachrc
25        else
26                # Do minimal environment setup
27                extend PATH $setup_dir/${bindir}
28                extend MANPATH $setup_dir/man
29        endif 
30else
31        echo ""
32        echo "The $SUBJECT filesystem could not be attached."
33        set filsys = `hesinfo $SUBJECT filsys`
34        if ($#filsys < 3) then
35                echo "Check your spelling of the filesystem name."
36        else
37                echo -n "The $filsys[1] fileserver"
38                if ($filsys[1] != AFS) echo -n " named $filsys[3]"
39                echo " may be down."
40        endif
41        if ($?XSESSION) then
42                echo "Type exit to get rid of this window."
43        else
44                kill -HUP $$    # cause shell to exit
45        endif
46endif
47unsetenv SUBJECT        # to prevent infinite loops
Note: See TracBrowser for help on using the repository browser.