diff options
author | Aaron LI <aly@aaronly.me> | 2022-01-15 10:56:44 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2023-06-13 10:01:03 +0800 |
commit | 0235adb5d52110d951e9001d46ecbc52192a5e01 (patch) | |
tree | 61abcf8f2a083c0de6be22ab62261928c9120c6b | |
parent | 07a7bab4bd2d3ae4a6e96528b1f1db65d0aadbc8 (diff) | |
download | dotfiles-0235adb5d52110d951e9001d46ecbc52192a5e01.tar.bz2 |
zsh: Add zlibd() to uncompress zlib data
-rw-r--r-- | _zshrc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -252,6 +252,13 @@ cdiff() { diff -u "$@" | cpatch } +## Uncompress zlib data +# Credit: https://unix.stackexchange.com/a/49066 +zlibd() { + # Prepend the gzip magic number and compress method. + { printf '\x1f\x8b\x08\x00\x00\x00\x00\x00'; cat "$@"; } | gzip -dc +} + # # Terminal settings # |