diff options
author | xengineering <me@xengineering.eu> | 2025-07-26 10:58:52 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2025-07-26 10:58:52 +0200 |
commit | 63da5b3514a58ecc9ae6f4349065af4a714de457 (patch) | |
tree | 2b622403374fd2c0fb6ba79a083ef8618bc4d6af | |
parent | a0e49f1b889a2bc79665ce6a32b050302a87669e (diff) | |
download | dotfiles-63da5b3514a58ecc9ae6f4349065af4a714de457.tar dotfiles-63da5b3514a58ecc9ae6f4349065af4a714de457.tar.zst dotfiles-63da5b3514a58ecc9ae6f4349065af4a714de457.zip |
posix-shell: utils: Add `lar()`
The list archive (`lar`) util creates a temporary directory, unpacks the
given tar archive into it, switches to that folder, starts the terminal
file manager `lf` and on quit jumps back and deletes the temporary
directory.
This is useful to quickly inspect the contents of a tar archive.
-rw-r--r-- | posix-shell/utils.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/posix-shell/utils.sh b/posix-shell/utils.sh index 596263e..b1ffc21 100644 --- a/posix-shell/utils.sh +++ b/posix-shell/utils.sh @@ -216,3 +216,12 @@ url() { # open selected URL in browser firefox "${url}" } + +lar() { + temp="$(mktemp -d)" + tar -xf "$1" -C "$temp" + pushd "$temp" + lf + popd + rm -rf "$temp" +} |