# -*-shell-script-*-
# JLdL 21Jul04.
#
# Set up the executable search path. The order is important!
#
# Clear the path.
set path = ""
#
# First the part for all shells, interactive and non-interactive.
# _ No /usr/local/ here, to avoid forcing an automatic mount.
set path = ( $path /root/bin )
set path = ( $path /bin )
set path = ( $path /sbin )
set path = ( $path /usr/bin )
set path = ( $path /usr/sbin )
set path = ( $path /usr/bin/X11 )
#
# Complete the path for interactive shells.
if ( $?prompt ) then
    #
    # Check whether the /usr/local/ directory is OK, but in
    # _ such a way as not to force an automatic mount.
    if ( ! $?USRLCLOK ) then
	if ( `\ls -ld /usr/local | cut -c 1` == d ) then
	    if ( `\ls -ld /usr/local/cbin | cut -c 1` == d ) then
		setenv USRLCLOK
	    endif
	endif
	#
	# If not, let the root user decide whether or
	# _ not to risk forcing an automatic mount.
	if ( ! $?USRLCLOK ) then
	    echo -n "Add the /usr/local/ paths? [y]: "; set idec = "$<"
	    if ( "$idec" == "" || "$idec" == Y ) set idec = y
	    if ( "$idec" == y ) setenv USRLCLOK
	endif
    endif
    #
    # If all is well, add the /usr/local/ parts.
    if ( $?USRLCLOK ) then
	set path = ( $path /usr/local/bin )
	set path = ( $path /usr/local/sbin )
	set path = ( $path /usr/local/cbin )
	set path = ( $path /usr/local/bin/X11 )
    endif
endif
