#!/bin/csh -f
# This script takes one argument: the name of a file to source.
# The file is sourced (if it can be found), and a csh begun.

switch ($#argv)
case 1:	
    if (! -r $1 && ! -r $HOME/$1) then 
        echo "csh_source error: initialization file  $1  does not exist."
        sleep 5
        exit
        breaksw
    endif
    if (-r $1) then
        echo "Sourcing file $1 and starting csh."
        source $1
        breaksw
    endif
    if (-r $HOME/$1) then
        echo "Sourcing file $HOME/$1 and starting csh."
        source $HOME/$1
        breaksw
    endif
    breaksw
default:
    echo "csh_source error: Incorrect number of arguments ($#argv)."
    sleep 5
    exit
    breaksw
endsw

exec /bin/csh
