diff options
author | Ryan Kavanagh <rak@rak.ac> | 2020-09-11 14:50:44 -0400 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2020-09-11 14:50:44 -0400 |
commit | 0dc7b92e2b3015e0ba872a48d89af2ea7ebd5b54 (patch) | |
tree | 8e61c08540f95fea2f86679eb4d13ef4a537b148 | |
parent | Add exclusion option (diff) |
Better cope with spaces in filenames
-rwxr-xr-x | ptmp | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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}" |