Skip to content
Snippets Groups Projects
Commit a8901984 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Fixed rmexp to actually be able to remove restart and log dirs; changed to...

Fixed rmexp to actually be able to remove restart and log dirs; changed to check existence of dir before removing
parent c61ae746
No related branches found
No related tags found
No related merge requests found
......@@ -20,34 +20,23 @@ Usage: $PROGRAM config_file [key=value...]"
CONFIG=$1
shift
eval `getexp "$CONFIG" "$@" || echo \; exit $?`
echo -n "$PROGRAM: remove ${EXP_ID}'s working directory and its contents [no]? " >&2
read answer
case "$answer" in
y*|Y*) rm -rv $WORK_DIR;;
esac
echo -n "$PROGRAM: remove ${EXP_ID}'s restart directory and its contents [no]? " >&2
read answer
case "$answer" in
y*|Y*) rm -rv $RESTART_DIR;;
esac
echo -n "$PROGRAM: remove ${EXP_ID}'s script directory and its contents [no]? " >&2
read answer
case "$answer" in
y*|Y*) rm -rv $SCRIPT_DIR;;
esac
echo -n "$PROGRAM: remove ${EXP_ID}'s log directory and its contents [no]? " >&2
read answer
case "$answer" in
y*|Y*) rm -rv $LOG_DIR;;
esac
eval `getexp -v "$CONFIG" "$@" || echo \; exit $?`
function ask_and_remove {
typeset label="$1"
typeset dir="$2"
if [[ -d "$dir" ]]
then
echo -n "$PROGRAM: remove ${EXP_ID}'s $label directory and its contents [no]? " >&2
read answer
case "$answer" in
y*|Y*) rm -rv $dir;;
esac
fi
}
echo -n "$PROGRAM: remove ${EXP_ID}'s data directory and its contents [no]? " >&2
read answer
case "$answer" in
y*|Y*) rm -rv $DATA_DIR;;
esac
ask_and_remove working $WORK_DIR
ask_and_remove restart $RESTART_DIR
ask_and_remove script $SCRIPT_DIR
ask_and_remove log $LOG_DIR
ask_and_remove data $DATA_DIR
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment