From 69b2d8b0219bfa9a4cfab8bbabda6cd395aada97 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 12 Jul 2024 23:54:05 -0400 Subject: regenerate man pages. --- diffbas | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'diffbas') diff --git a/diffbas b/diffbas index fe69304..b5160fe 100755 --- a/diffbas +++ b/diffbas @@ -12,7 +12,14 @@ EOF exit "$1" } -if [ "$@" = "-h" -o "$@" = "--help" ]; then +cleanup() { + if [ "$dir" != "" ]; then + cd + rm -rf "$dir" + fi +} + +if [ "$1" = "-h" -o "$1" = "--help" -o "$1" = "" ]; then usage 0 fi @@ -20,8 +27,10 @@ for i in "$@"; do if [ -f "$i" ]; then if [ "$file1" = "" ]; then file1="$( realpath $i )" + base1="$( basename $i )".lst elif [ "$file2" = "" ]; then file2="$( realpath $i )" + base2="$( basename $i )".lst else usage 1 fi @@ -34,19 +43,13 @@ for i in "$@"; do fi done -## cat < 1 -listbas $listbasopts "$file2" > 2 -diff $diffopts 1 2 -cd -rm -rf "$dir" +dir="$( mktemp -d -t diffbas.XXXXXXXXXX )" +[ -d "$dir" ] +cd "$dir" +trap cleanup EXIT + +listbas $listbasopts "$file1" > $base1 +listbas $listbasopts "$file2" > $base2 +diff $diffopts $base1 $base2 + +exit 0 -- cgit v1.2.3