New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Fclean_config.sh in branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE/Fclean_config.sh @ 2301

Last change on this file since 2301 was 2301, checked in by flavoni, 14 years ago

improvement of makenemo , see ticket : #740

  • Property svn:executable set to *
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_fcm
7# Fclean_config   : config removing
8######################################################
9#set -x
10set -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#
38# EXAMPLES
39# ========
40#
41# ::
42#
43#  $ ./Fclean_config.sh
44#
45#
46# TODO
47# ====
48#
49# option debug
50#
51#
52# EVOLUTIONS
53# ==========
54#
55# $Id: Fclean_config.sh 2158 2010-10-20 17:30:03Z sflod $
56#
57#
58#
59#   * creation
60#
61#-
62 NEW_CONF=${x_n}
63 echo "Removing bad configuration : ${NEW_CONF}" 
64 echo "Are you sure that you want to remove this directory ? [y/n] "
65 read answer
66 answer=`echo $answer | sed 's/^[y].*$/y/'`
67 if [  -z "$answer" -o "x$answer" = "xy" ]; then
68   # testing if configuration exists
69   if [ "$(cat ${COMPIL_DIR}/cfg.txt | grep "${NEW_CONF} ")"  == "" ] ; then
70      echo "The configurationn_config.sh ${NEW_CONF} does not exist"     
71      echo "No removing configuration"
72      echo " "
73        else
74      rm -rf ${CONFIG_DIR}/${NEW_CONF}
75      sed -e "/${NEW_CONF} /d"  ${COMPIL_DIR}/cfg.txt >  ${COMPIL_DIR}/cfg.tmp
76      mv  ${COMPIL_DIR}/cfg.tmp  ${COMPIL_DIR}/cfg.txt
77      echo "${NEW_CONF} configuration REMOVED" 
78        fi
79 else
80   echo " "
81   echo "nothing to remove"
82 fi
83
84 unset -v answer
Note: See TracBrowser for help on using the repository browser.