From 39d0ae37cbd478cab605397e99e468768825f764 Mon Sep 17 00:00:00 2001 From: Jan Krautmacher Date: Thu, 25 Sep 2025 07:19:35 +0200 Subject: posix-shell: utils: Add `lar()` The `lar` (list archive) function is a utility to quickly inspect an archive file. --- posix-shell/utils.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/posix-shell/utils.sh b/posix-shell/utils.sh index f19602d..4354a37 100644 --- a/posix-shell/utils.sh +++ b/posix-shell/utils.sh @@ -243,3 +243,18 @@ hexdiff() { rm -f "$dump1" "$dump2" } + +lar() { + if test "$#" -ne 1 + then + echo "Usage: lar " + return 1 + fi + + temporary_directory="$(mktemp -d)" + tar -xf "$1" -C "$temporary_directory" + pushd "$temporary_directory" + lf + popd + rm -rf "$temporary_directory" +} -- cgit v1.2.3-70-g09d2