diff options
author | Ian C <ianc@noddybox.co.uk> | 2024-08-27 18:24:22 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2024-08-27 18:24:22 +0100 |
commit | 83b338f37d60e63a27abd19e744e87d86eae8dfb (patch) | |
tree | 2a85e2d2e204eb521a9c92699340beef723af27c | |
parent | 1a625a73cad0fff566236c2624444fe78c6390d1 (diff) |
Update to extract_zips.sh to handle spaces better
-rwxr-xr-x | extract_zips.sh | 13 |
1 files changed, 8 insertions, 5 deletions
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 |