source:
branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE/Fcheck_config.sh
@
2359
Last change on this file since 2359 was 2359, checked in by flavoni, 14 years ago | |
---|---|
|
|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[1972] | 1 | #!/bin/bash |
2 | ###################################################### | |
3 | # Author : Rachid Benshila for NEMO | |
4 | # Contact : rblod@locean-ipsl.upmc.fr | |
5 | # | |
[2359] | 6 | # Some functions called from makenemo |
[1972] | 7 | # Fcheck_config : config checking |
8 | ###################################################### | |
9 | #set -x | |
10 | set -o posix | |
11 | #set -u | |
12 | #set -e | |
13 | #+ | |
14 | # | |
15 | # ================ | |
16 | # Fcheck_config.sh | |
17 | # ================ | |
18 | # | |
19 | # -------------------------- | |
20 | # Check the configuration | |
21 | # -------------------------- | |
22 | # | |
23 | # SYNOPSIS | |
24 | # ======== | |
25 | # | |
26 | # :: | |
27 | # | |
[2158] | 28 | # $ Fcheck_config.sh FILENAME CONFNAME |
[1972] | 29 | # |
30 | # | |
31 | # DESCRIPTION | |
32 | # =========== | |
33 | # | |
34 | # | |
35 | # Check the choice of the configuration: | |
36 | ||
37 | # - Two cases | |
38 | # - One is explicitely set | |
[2158] | 39 | # - Nothing set, use the previous in use |
[1972] | 40 | # |
41 | # EXAMPLES | |
42 | # ======== | |
43 | # | |
44 | # :: | |
45 | # | |
46 | # $ ./Fcheck_config.sh | |
47 | # | |
48 | # | |
49 | # TODO | |
50 | # ==== | |
51 | # | |
52 | # option debug | |
53 | # | |
54 | # | |
55 | # EVOLUTIONS | |
56 | # ========== | |
57 | # | |
58 | # $Id$ | |
59 | # | |
60 | # | |
61 | # | |
62 | # * creation | |
63 | # | |
64 | #- | |
65 | ||
66 | declare -a ZTAB | |
[2158] | 67 | if [ ${#2} -eq 0 ]; then |
68 | tail -1 ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/cfg.tmp | |
[2136] | 69 | read -a ZTAB < ${COMPIL_DIR}/cfg.tmp |
[1972] | 70 | NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} ) |
[2136] | 71 | \rm ${COMPIL_DIR}/cfg.tmp |
[1972] | 72 | echo "Warning !!!" |
73 | echo "No configuration specified" | |
[2359] | 74 | echo "Use makenemo -n MYCONFIG" |
75 | echo "or makenemo -h for help" | |
[1972] | 76 | echo "Using defaut configuration : ${NEW_CONF}" |
77 | fi | |
[2158] | 78 | if [ "$1" == cfg.txt ]; then |
79 | cat ${COMPIL_DIR}/$1 | grep "${NEW_CONF} " > ${COMPIL_DIR}/cfg.tmp | |
80 | read -a ZTAB < ${COMPIL_DIR}/cfg.tmp | |
81 | NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} ) | |
82 | \rm ${COMPIL_DIR}/cfg.tmp | |
83 | fi | |
[1972] | 84 | |
85 | unset -v ZTAB |
Note: See TracBrowser
for help on using the repository browser.