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 @ 2359

Last change on this file since 2359 was 2359, checked in by flavoni, 13 years ago

cosmetic changes, see ticket #752

  • 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
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 "Are you sure that you want to remove this directory ? [y/n] "
64 read answer
65 answer=`echo $answer | sed 's/^[y].*$/y/'`
66 if [  -z "$answer" -o "x$answer" = "xy" ]; then
67   # testing if configuration exists
68   if [ "$(cat ${COMPIL_DIR}/cfg.txt | grep "${NEW_CONF} ")"  == "" ] ; then
69      echo "The configuration ${NEW_CONF} does not exist in file cfg.txt"     
70      echo "No removing configuration"
71      echo " "
72        else
73      rm -rf ${CONFIG_DIR}/${NEW_CONF}
74      sed -e "/${NEW_CONF} /d"  ${COMPIL_DIR}/cfg.txt >  ${COMPIL_DIR}/cfg.tmp
75      mv  ${COMPIL_DIR}/cfg.tmp  ${COMPIL_DIR}/cfg.txt
76      echo "${NEW_CONF} configuration REMOVED" 
77        fi
78 else
79   echo " "
80   echo "nothing to remove"
81 fi
82
83 unset -v answer
Note: See TracBrowser for help on using the repository browser.