https://github.com/teuben/nemo
Raw File
Tip revision: 738a73b7c231dbcaa6218d977354d65263dbd6d2 authored by Peter Teuben on 22 May 2010, 22:47:18 UTC
committed as work I must have done a while back (2007?) to get plplot
Tip revision: 738a73b
nemo.rc
# This file is to be sourced to add NEMO to your environment, but
# is mostly called by "nemo_start"
#
# 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
#    		     10-apr-01  NEMO V3 - small verbosity changes 	PJT
#		     20-jun-01  no more bells		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 (! -d $NEMOBIN) then
  echo "Warning: $NEMOBIN does not exist (yet)"
  echo "Look at targets fakehost and truehost in $NEMO/Makefile"
else
  if (-e $NEMOBIN/cc) then
    echo "Warning: you still carry $NEMOBIN/cc, which is not NEMO V3 compliant"
  endif
endif
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 load falcON, if present
#alias falcON 'setenv FALCON $NEMO/usr/dehnen/falcON; source $FALCON/falcON_start'
setenv FALCON $NEMO/usr/dehnen/falcON
source $FALCON/falcON_start

# provide alias to end NEMO
#alias omen 'source $NEMO/nemo_end; unalias omen; alias nemo source $NEMO/nemo_start'
alias omen 'source $NEMO/nemo_end; unalias omen'

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

# if (-e $NEMO/etc/motd) cat $NEMO/etc/motd
if ($?prompt) then
  echo "NEMO $NEMOVER loaded for HOST $NEMOHOST from $NEMO"
#  echo "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