From 7b21727285e50b0b050c4ddd70d07542229c5366 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:17:03 -0700 Subject: init --- bin/multi_unzip | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 bin/multi_unzip (limited to 'bin/multi_unzip') diff --git a/bin/multi_unzip b/bin/multi_unzip new file mode 100755 index 0000000..94ecd3f --- /dev/null +++ b/bin/multi_unzip @@ -0,0 +1,13 @@ +#!/bin/sh + +# unzips the contents of every present zip archive into directories of the same name +# the % is used to remove the file extension (.zip). +# % matches the shortest occurence from the end. +# %% would remove all extensions (.tar.gz would be matched by %%) +# # and ## are the corresponding operators for matching at the beginning + +for file in ./*.zip; do + dir_name=${file%.*} + mkdir -p "$dir_name" + unzip -d "$dir_name" "$file" +done -- cgit v1.2.3