Changeset 3294 for trunk/NEMOGCM/TOOLS/COMPILE/Fclean_config.sh
- Timestamp:
- 2012-01-28T17:44:18+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/TOOLS/COMPILE/Fclean_config.sh
r2520 r3294 64 64 #- 65 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 " " 66 if [ ${#NEW_CONF} -eq 0 ] ; then 67 echo " " 68 echo "No configuration specified, please use makenemo -n CONFIG clean_config " 69 else 70 echo "Are you sure that you want to remove this directory $NEW_CONF? [y/n] " 71 read answer 72 answer=`echo $answer | sed 's/^[y].*$/y/'` 73 if [ -z "$answer" -o "x$answer" = "xy" ]; then 74 # testing if configuration exists 75 if [ "$(cat ${CONFIG_DIR}/cfg.txt | grep "${NEW_CONF} ")" == "" ] ; then 76 echo "The configuration ${NEW_CONF} does not exist in file cfg.txt" 77 echo "No removing configuration" 78 echo " " 75 79 else 76 rm -rf ${CONFIG_DIR}/${NEW_CONF}77 sed -e "/${NEW_CONF} /d" ${COMPIL_DIR}/cfg.txt > ${COMPIL_DIR}/cfg.tmp78 mv ${COMPIL_DIR}/cfg.tmp ${COMPIL_DIR}/cfg.txt79 echo "${NEW_CONF} configuration REMOVED"80 rm -rf ${CONFIG_DIR}/${NEW_CONF} 81 sed -e "/${NEW_CONF} /d" ${CONFIG_DIR}/cfg.txt > ${CONFIG_DIR}/cfg.tmp 82 mv ${CONFIG_DIR}/cfg.tmp ${CONFIG_DIR}/cfg.txt 83 echo "${NEW_CONF} configuration REMOVED" 80 84 fi 81 else82 echo " "83 echo "nothing to remove"84 fi85 85 else 86 echo " " 87 echo "nothing to remove" 88 fi 89 fi 86 90 unset -v answer
Note: See TracChangeset
for help on using the changeset viewer.