X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=blobdiff_plain;f=freeze-dir.sh;h=81f4a6d7a98ef635ca96ba188ac486e55f2555ed;hp=375db4b97a31bcdd978dd562b974ff29591f3633;hb=caef54051c89be32e693aeed90fa915f621fce47;hpb=b6ac52d5f308a3faa97c5e974c8719ca43ae4430 diff --git a/freeze-dir.sh b/freeze-dir.sh index 375db4b..81f4a6d 100755 --- a/freeze-dir.sh +++ b/freeze-dir.sh @@ -24,7 +24,10 @@ set -e -[[ ${FREEZE_DIR} ]] || FREEZE_DIR=${HOME}/.backups +# The default directory does not start with a period, as it may be +# huge and should not be "hidden" from the user. + +[[ ${FREEZE_DIR} ]] || FREEZE_DIR=${HOME}/freezer if [[ ! -d ${FREEZE_DIR} ]]; then echo "Can not find directory ${FREEZE_DIR}" >&2 @@ -32,7 +35,7 @@ if [[ ! -d ${FREEZE_DIR} ]]; then fi while [[ "$1" ]]; do - real_path=$(realpath "$1") + real_path="$(realpath "$1")" dir=$(basename "${real_path}") path=$(dirname "${real_path}") full_path="${path}/${dir}"