source:
tags/nemo_v3_3_2/NEMOGCM/TOOLS/COMPILE/Fclean_config.sh
@
3293
Last change on this file since 3293 was 2520, checked in by rblod, 14 years ago | |
---|---|
|
|
File size: 1.6 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 | # Fclean_config : config removing |
8 | ###################################################### |
9 | #set -x |
10 | set -o posix |
11 | #set -u |
12 | #set -e |
13 | #+ |
14 | # |
15 | # ================ |
16 | # Fclean_config.sh |
17 | # ================ |
18 | # |
19 | # ------------------------ |
20 | # Remove the configuration |
21 | # ------------------------ |
22 | # |
23 | # SYNOPSIS |
24 | # ======== |
25 | # |
26 | # :: |
27 | # |
28 | # $ Fclean_config.sh CONFNAME |
29 | # |
30 | # |
31 | # DESCRIPTION |
32 | # =========== |
33 | # |
34 | # |
35 | # Remove the configuration: |
36 | # |
37 | # - remove CONFIG_NAME/WORK |
38 | # - remove CONFIG_NAME/BLD |
39 | # - remove CONFIG_NAME from TOOLS/TOOLS/COMPILE/cfg.txt |
40 | # |
41 | # EXAMPLES |
42 | # ======== |
43 | # |
44 | # :: |
45 | # |
46 | # $ ./Fclean_config.sh ORCA2_LIM |
47 | # |
48 | # |
49 | # TODO |
50 | # ==== |
51 | # |
52 | # option debug |
53 | # |
54 | # |
55 | # EVOLUTIONS |
56 | # ========== |
57 | # |
58 | # $Id: Fclean_config.sh 2158 2010-10-20 17:30:03Z sflod $ |
59 | # |
60 | # |
61 | # |
62 | # * creation |
63 | # |
64 | #- |
65 | NEW_CONF=${x_n} |
66 | echo "Are you sure that you want to remove this directory ? [y/n] " |
67 | read answer |
68 | answer=`echo $answer | sed 's/^[y].*$/y/'` |
69 | if [ -z "$answer" -o "x$answer" = "xy" ]; then |
70 | # testing if configuration exists |
71 | if [ "$(cat ${COMPIL_DIR}/cfg.txt | grep "${NEW_CONF} ")" == "" ] ; then |
72 | echo "The configuration ${NEW_CONF} does not exist in file cfg.txt" |
73 | echo "No removing configuration" |
74 | echo " " |
75 | else |
76 | rm -rf ${CONFIG_DIR}/${NEW_CONF} |
77 | sed -e "/${NEW_CONF} /d" ${COMPIL_DIR}/cfg.txt > ${COMPIL_DIR}/cfg.tmp |
78 | mv ${COMPIL_DIR}/cfg.tmp ${COMPIL_DIR}/cfg.txt |
79 | echo "${NEW_CONF} configuration REMOVED" |
80 | fi |
81 | else |
82 | echo " " |
83 | echo "nothing to remove" |
84 | fi |
85 | |
86 | unset -v answer |
Note: See TracBrowser
for help on using the repository browser.