diff options
-rw-r--r-- | posix-shell/utils.sh | 15 |
1 files changed, 15 insertions, 0 deletions
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 <archive-file>" + return 1 + fi + + temporary_directory="$(mktemp -d)" + tar -xf "$1" -C "$temporary_directory" + pushd "$temporary_directory" + lf + popd + rm -rf "$temporary_directory" +} |