Skip to content
Snippets Groups Projects
  • Brad Sawatzky's avatar
    5afc3f8a
    Tweak 'interactive shell' fallback so it is more general · 5afc3f8a
    Brad Sawatzky authored
    - Apparently  $?loginsh is not a good indicator of whether tcsh is
      interactive (bad Google...) so we'll look for 'setup.csh' in the
      current directory and if it is present assume it is the hcana/
      directory.
    - The if($?prompt) clause should print some info text if you're
      interactive.  (Although it's not definitive either -- dammit csh.)
    
    -- Brad
    5afc3f8a
    History
    Tweak 'interactive shell' fallback so it is more general
    Brad Sawatzky authored
    - Apparently  $?loginsh is not a good indicator of whether tcsh is
      interactive (bad Google...) so we'll look for 'setup.csh' in the
      current directory and if it is present assume it is the hcana/
      directory.
    - The if($?prompt) clause should print some info text if you're
      interactive.  (Although it's not definitive either -- dammit csh.)
    
    -- Brad
setup.csh 992 B
#!/bin/csh

if ( -r "./setup.csh" ) then
  set MYDIR=`pwd`
  if ($?prompt) then
    echo "--> Setting HCANALYZER to '$MYDIR'"
  endif
else
  if ( "$1" == "" ) then
    echo "ERROR:  'setup.csh' should have a path to the hcana location as its argument."
    echo "   Often this is also the location of the setup.csh script itself:"
    echo "     source /my/path/to/setup.csh /my/path/to/setup.csh"
    echo "   Or, if you have already cd'd into the hcana directory, then you can call:"
    echo '     source setup.csh `pwd`'
    exit 1
  else
    set MYDIR=$1
  endif
endif

setenv ANALYZER $MYDIR/podd
setenv HCANALYZER $MYDIR
# Check if LD_LIBRARY_PATH is defined
if ( ! ($?LD_LIBRARY_PATH) ) then
   setenv LD_LIBRARY_PATH ""
endif
# Check if DYLD_LIBRARY_PATH is defined
if ( ! ($?DYLD_LIBRARY_PATH) ) then
   setenv DYLD_LIBRARY_PATH ""
endif
setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:${ANALYZER}:${HCANALYZER}"
setenv DYLD_LIBRARY_PATH "${DYLD_LIBRARY_PATH}:${ANALYZER}:${HCANALYZER}"