From 0dc7b92e2b3015e0ba872a48d89af2ea7ebd5b54 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Fri, 11 Sep 2020 14:50:44 -0400 Subject: Better cope with spaces in filenames --- ptmp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ptmp b/ptmp index 125d8dc..e2446c5 100755 --- a/ptmp +++ b/ptmp @@ -28,11 +28,15 @@ do done shift `expr $OPTIND - 1` -PAD=$(md5sum $1 | cut -f1 -d' ') -BASE=$(basename $1) +FILE="$@" + +PAD=$(md5sum "${FILE}" | cut -f1 -d' ') +BASE=$(basename "${FILE}") DEST_NAME="${PAD}.${BASE}${OPT_SUFFIX}" -scp $1 "${DEST_DIR}/${DEST_NAME}" +echo "${DEST_NAME}" + +scp "${FILE}" "${DEST_DIR}/${DEST_NAME}" echo "https://rak.ac/~tmp/${DEST_NAME}" -- cgit v1.2.3