diff options
author | Yuchen Pei <id@ypei.org> | 2025-06-23 09:32:41 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2025-06-23 09:32:41 +1000 |
commit | 039d8f2a26dbbbab8b7bc012f3f12107916b90b5 (patch) | |
tree | 372599bef1cfa6c7df47a31e2610edcd520e7a93 /misc | |
parent | b5f7c2c807e7947f877b48a38729aa884cdb6bc1 (diff) |
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/bin/unzipall.sh | 8 | ||||
-rwxr-xr-x | misc/bin/zipall.sh | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/misc/bin/unzipall.sh b/misc/bin/unzipall.sh new file mode 100755 index 0000000..2d654f0 --- /dev/null +++ b/misc/bin/unzipall.sh @@ -0,0 +1,8 @@ +#/bin/bash + +# unzip all zip/7z files with 7z in pwd +for f in ./*; do + ext=${f##*.} + if test "$ext" = zip; then 7z e "$f"; fi; + if test "$ext" = 7z; then 7z e "$f"; fi; +done diff --git a/misc/bin/zipall.sh b/misc/bin/zipall.sh new file mode 100755 index 0000000..0a244c2 --- /dev/null +++ b/misc/bin/zipall.sh @@ -0,0 +1,9 @@ +#/bin/bash + +# zip all non-7z and non-zip files with 7z in pwd and delete the original +for f in ./*; do + ext=${f##*.} + if test "$ext" = zip; then continue; fi; + if test "$ext" = 7z; then continue; fi; + 7z a -sdel "$f.7z" "$f" +done |