The bash file of
for i in 0 3 4 6 16 21 22; do
# need to download the data cd $CODA_ROOT_DIR/..
python scripts/download_split.py -d ./data -t sequence -se $i <<< "Y"
# need to process the data cd $REMEMBR_PATH
python scripts/preprocess_coda.py -s $i
# delete original data
rm -rf $CODA_ROOT_DIR/*
done
is dangerous if $CODA_ROOT_DIR is blank. Then this command will delete all files under home. A safer version:
#!/usr/bin/env bash
set -euo pipefail # if not set then quit
shopt -s failglob
: "${CODA_ROOT_DIR:?set CODA_ROOT_DIR to /path/to/coda-devkit/data}"
: "${REMEMBR_PATH:?set REMEMBR_PATH to /path/to/remembr}"
CODA_ROOT_DIR="$(readlink -f "$CODA_ROOT_DIR")"
case "$CODA_ROOT_DIR" in
/|/home|"$HOME"|/home/*) echo "Refusing to operate on $CODA_ROOT_DIR"; exit 1;;
esac
for i in 0 3 4 6 16 21 22; do
cd "$CODA_ROOT_DIR/.." || exit 1
python scripts/download_split.py -d ./data -t sequence -se "$i" <<< "Y"
cd "$REMEMBR_PATH" || exit 1
python scripts/preprocess_coda.py -s "$i"
find "$CODA_ROOT_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +
done
The bash file of
is dangerous if
$CODA_ROOT_DIRis blank. Then this command will delete all files underhome. A safer version: