From 83b338f37d60e63a27abd19e744e87d86eae8dfb Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 27 Aug 2024 18:24:22 +0100 Subject: Update to extract_zips.sh to handle spaces better --- extract_zips.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'extract_zips.sh') diff --git a/extract_zips.sh b/extract_zips.sh index 749b6f4..e903ee7 100755 --- a/extract_zips.sh +++ b/extract_zips.sh @@ -5,11 +5,14 @@ if [ "x$1" = "x-j" ] ; then shift fi +IFS=' +' + for i in $* ; do - dir=$(basename $i .zip) - mkdir $dir - cd $dir - unzip $switch ../$i + dir="$(basename $i .zip)" + mkdir "$dir" + cd "$dir" + unzip $switch "../$i" cd .. - rm $i + rm "$i" done -- cgit v1.2.3