From: Rudolf Polzer Date: Tue, 9 Nov 2010 06:10:44 +0000 (+0100) Subject: update-cvarcount: small hack to make do without mktemp if needed X-Git-Tag: xonotic-v0.1.0preview~131^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=81680ef70a876bd158724525b40a72a5acc53aef;p=xonotic%2Fxonotic-data.pk3dir.git update-cvarcount: small hack to make do without mktemp if needed --- diff --git a/update-cvarcount.sh b/update-cvarcount.sh index b82840ae0..0bd63e9fb 100755 --- a/update-cvarcount.sh +++ b/update-cvarcount.sh @@ -6,12 +6,12 @@ for b in balance*.cfg; do if [ "$countw" != "$countb" ]; then echo "Mismatch between balanceXonotic.cfg and $b. Aborting." echo "Differences are:" - A=`mktemp` - B=`mktemp` - awk '/^seta? g_/ { print $2; }' balanceXonotic.cfg | sort -u | tr -d '\r' > "$A" - awk '/^seta? g_/ { print $2; }' "$b" | sort -u | tr -d '\r' > "$B" echo "< missing in $b" echo "> must get removed from $b" + A=`mktemp || echo a.tmp` + B=`mktemp || echo b.tmp` + awk '/^seta? g_/ { print $2; }' balanceXonotic.cfg | sort -u | tr -d '\r' > "$A" + awk '/^seta? g_/ { print $2; }' "$b" | sort -u | tr -d '\r' > "$B" diff "$A" "$B" | grep '^[<>]' | sort rm -f "$A" "$B" exit 1