From a1f12e3d25aaa932a252503da20a0a8fa2c646ad Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Wed, 14 Jan 2015 18:23:03 +0000 Subject: [PATCH] fswap: quote filenames --- bin/fswap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/fswap b/bin/fswap index 944cef3..c89308d 100755 --- a/bin/fswap +++ b/bin/fswap @@ -7,20 +7,20 @@ if [ $# != 2 ]; then exit 1 fi -if ! mv -i $1 $1.fswap.tmp.$$; then +if ! mv -i "$1" "$1.fswap.tmp.$$"; then echo "Failed to mv $1 $1.fswap.tmp.$$ ! Aborting." exit 1 fi -if ! mv -i $2 $1; then +if ! mv -i "$2" "$1"; then echo "Failed to mv $2 $1 ! Restoring $1." - if ! mv -i $1.fswap.tmp.$$ $1; then + if ! mv -i "$1.fswap.tmp.$$" "$1"; then echo "Failed to restore $1 !!" fi exit 1 fi -if ! mv -i $1.fswap.tmp.$$ $2; then +if ! mv -i "$1.fswap.tmp.$$" "$2"; then echo "Failed to mv $1.fswap.tmp.$$ to $2 !" exit 1 fi