File: GMXRC.in

package info (click to toggle)
gromacs 3.3.1-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 57,284 kB
  • ctags: 26,126
  • sloc: asm: 844,363; ansic: 231,461; sh: 15,665; makefile: 1,514; fortran: 1,362; csh: 715; python: 264; perl: 261
file content (63 lines) | stat: -rw-r--r-- 1,147 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This is a convenience script to determine which
# type of shell you have, and then run GMXRC.[csh|bash|zsh]
# from the Gromacs binary directory.
#
# If you only use one shell you can copy that GMXRC.* instead.


# only csh/tcsh understand 'set'
set is_csh = 123
test "$is_csh" = 123 && goto CSH

# if we got here, shell is bsh/bash/zsh/ksh
# bsh cannot remove part of a variable with %%
shtst="A.B"
if [ "`(echo ${shtst%%.*}) 2>/dev/null`" = A ]; then

  # shell is bash/zsh/ksh
  # bash/zsh use $[...] for arithmetic evaluation, ksh doesn't
  if [ "`echo $[0+1]`" = 1 ]; then
    
    # shell is zsh/bash
    # zsh can test if the variable shtst is set with ${+shtst}
    if [ "`(echo ${+shtst}) 2>/dev/null`" = 1 ]; then
      # shell is zsh
      source @bindir@/GMXRC.zsh
    else  
      # shell is bash
      source @bindir@/GMXRC.bash      
    fi

  else    
    # shell is ksh - use bash setup, completions won't be read.
     . @bindir@/GMXRC.bash
  fi
  return
else
  # shell is bsh - use bash setup, completions won't be read.
  . @bindir@/GMXRC.bash
  exit
fi

# csh/tcsh jump here

CSH:
source @bindir@/GMXRC.csh