summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2023-09-08 19:56:34 +0100
committerIan C <ianc@noddybox.co.uk>2023-09-08 19:56:34 +0100
commit8c62cfcff0c0727491aaa54e5288bf315716e7e8 (patch)
treee99a7be0f7342bb9bbbee60565e5eefadbca5164
parentb2f144aefd752c35464c6c28b78d1cc34f7ff540 (diff)
Added -j switch to flatten archive
-rwxr-xr-xextract_zips.sh7
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