source:
branches/2017/dev_r8183_ICEMODEL/NEMOGCM/TOOLS/COMPILE/Fadd_keys.sh
@
8282
Last change on this file since 8282 was 8282, checked in by clem, 8 years ago | |
---|---|
|
|
File size: 1.5 KB |
Line | |
---|---|
1 | #!/bin/bash |
2 | ###################################################### |
3 | # Author : Simona Flavoni for NEMO |
4 | # Contact : sflod@locean-ipsl.upmc.fr |
5 | # |
6 | # Some functions called from makenemo |
7 | # Fadd_keys : add keys in cpp.fcm file |
8 | ###################################################### |
9 | #set -x |
10 | set -o posix |
11 | #set -u |
12 | #set -e |
13 | #+ |
14 | # |
15 | # ============ |
16 | # Fadd_keys.sh |
17 | # ============ |
18 | # |
19 | # -------------------- |
20 | # Add compilation keys |
21 | # -------------------- |
22 | # |
23 | # SYNOPSIS |
24 | # ======== |
25 | # |
26 | # :: |
27 | # |
28 | # $ Fadd_keys.sh CONFIG_NAME add_key "LIST_KEYS" |
29 | # |
30 | # |
31 | # DESCRIPTION |
32 | # =========== |
33 | # |
34 | # |
35 | # Script to add a set of key when compiling a configuration. |
36 | # The list of key to be added has to be enclosed with " ". |
37 | # A 'sed' is performed to modify the CONFIG_NAME/cpp.fcm file to |
38 | # add the new key(s). |
39 | # |
40 | # |
41 | # EXAMPLES |
42 | # ======== |
43 | # |
44 | # :: |
45 | # |
46 | # $ ./Fadd_keys.sh ORCA2_LIM add_key "key_mpp_rep" |
47 | # |
48 | # |
49 | # TODO |
50 | # ==== |
51 | # |
52 | # option debug |
53 | # |
54 | # |
55 | # EVOLUTIONS |
56 | # ========== |
57 | # |
58 | # $Id: Fadd_keys.sh 2158 2010-10-20 17:30:03Z sflod $ |
59 | # |
60 | # |
61 | # |
62 | # * creation |
63 | # |
64 | #- |
65 | echo "Adding keys in : ${NEW_CONF}" |
66 | for i in ${list_add_key} ; do |
67 | if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "\<$i\>" )" -ne 0 ] ; then |
68 | echo "key $i already present in cpp_${NEW_CONF}.fcm" |
69 | else |
70 | sed -e "s/$/ ${i}/" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp |
71 | mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm |
72 | echo "added key $i in ${NEW_CONF}" |
73 | fi |
74 | done |
75 | |
76 | unset -v list_add_key |
77 |
Note: See TracBrowser
for help on using the repository browser.