https://github.com/teuben/nemo
Raw File
Tip revision: fc01bbbac3c2d057385ffd4922eeed602a7e2973 authored by Peter Teuben on 02 April 2001, 00:02:03 UTC
import NEMO V3
Tip revision: fc01bbb
nemo.rc
# This file is to be sourced to add NEMO to your environment
#
# Normally sourcing this file (in csh) will only be allowed
# once, because an assumed alias 'nemo' does it. If this is done
# successfully, the alias 'nemo' is overwritten with another one
#
# This script relies upon the fact that the environment variable NEMO
# exists, but NEMOBIN does not yet (as it is set through the NEMORC script).
# If NEMOBIN does exist, it is considered an error, and aborted
# Hence 'unsetenv NEMOBIN' is the only way for re-entry.
#
#	Last update: 25-jan-90	created             Peter Teuben	
#                     8-oct-90  new nemo            PJT
#		      3-mar-92  doc		    PJT
#                     6-jul-92  denemo              PJT
#                    26-mar-94  NEMO V2.2           pjt

#                           decide if to be run in more verbose way
if ($?DEBUG == 0) then
  set debug=0
else
  set debug=1
endif
if ($debug == 1) then
 echo -n "Add the NEMO environment? [y/n]: "
 set ans=$<
else
 set ans=y
endif
if ("$ans" != "y") then
  goto done
endif

#                           See if NEMO had been set....
if ($?NEMO == 0) then
  echo "Environment variable NEMO is not set, NEMO cannot be set up"
  echo "add something like:   setenv NEMO /xxx/yyy"
  echo "to denote the root directory of NEMO to your .cshrc file"
  goto done
endif
if ($debug) echo NEMO=$NEMO


#                   NEMOBIN is used as a trigger to prevent multiple startup's
if ($?NEMOBIN != 0) then
  if (-d "$NEMOBIN") then
    echo "NEMOBIN=$NEMOBIN"
    echo "PATH=$PATH"
    echo ""
    echo "NEMOBIN had already been set, NEMO cannot be re-initialized"
    echo ""
    echo "   Use:  'unsetenv NEMOBIN' to get rid of the environment variable"
    echo "          NEMOBIN, and run 'nemo' again to (re)initialize NEMO"
    echo "or perhaps a bit more involved:"
    echo "   Use:  'unalias nemo' to have access to the 'nemo' shell"
    echo "          assuming NEMOBIN is in the PATH - perhaps use 'rehash'"
    echo "      **FIRST** check with: 'alias nemo' what your current alias for"
    echo "      nemo is."
    goto done
  endif
endif

if (-e $NEMO/NEMORC) then
  if ($debug) echo "Sourcing $NEMO/NEMORC ..."
  source $NEMO/NEMORC
else
  echo "NEMO startup file $NEMO/NEMORC does not exist"
  echo "Running NEMO on your own risk"
endif
if ($debug) echo "$NEMOBIN added to search path"
if ($path[1] == ".") then
  set path = ( . $NEMOBIN $path[2-] )
else
  set path = ( $NEMOBIN $path )
endif
if ($debug) echo "and rehashed it"
rehash

# provide alias to end NEMO
alias omen "source $NEMO/nemo_end"

if ($debug) echo All systems go...

# if (-e $NEMO/etc/motd) cat $NEMO/etc/motd
if ($?prompt) then
  echo "NEMO loaded. Type 'motd' to get messages of the day"
  echo "The alias 'omen' will attempt to unload NEMO from your environment"
endif

done:
back to top