diff options
author | Ian C <ianc@noddybox.co.uk> | 2023-09-08 19:56:34 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2023-09-08 19:56:34 +0100 |
commit | 8c62cfcff0c0727491aaa54e5288bf315716e7e8 (patch) | |
tree | e99a7be0f7342bb9bbbee60565e5eefadbca5164 | |
parent | b2f144aefd752c35464c6c28b78d1cc34f7ff540 (diff) |
Added -j switch to flatten archive
-rwxr-xr-x | extract_zips.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/extract_zips.sh b/extract_zips.sh index bf76d10..749b6f4 100755 --- a/extract_zips.sh +++ b/extract_zips.sh @@ -1,10 +1,15 @@ #!/bin/bash +if [ "x$1" = "x-j" ] ; then + switch=-j + shift +fi + for i in $* ; do dir=$(basename $i .zip) mkdir $dir cd $dir - unzip ../$i + unzip $switch ../$i cd .. rm $i done |