coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: use $AWK, not awk


From: Jim Meyering
Subject: [PATCH] tests: use $AWK, not awk
Date: Wed, 16 May 2012 07:49:56 +0200

FYI, I noticed a few hard-coded uses of "awk" in tests/:

>From 2e9f5ca4ebbbdb6a9fa2dd3d5add3f7720a172d7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 16 May 2012 07:46:51 +0200
Subject: [PATCH] tests: use $AWK, not awk

* tests/cp/sparse-fiemap: Don't hard-code "awk".  Use $AWK.
* tests/init.cfg: Likewise.
* tests/misc/sort-rand: Likewise.
---
 tests/cp/sparse-fiemap | 2 +-
 tests/init.cfg         | 2 +-
 tests/misc/sort-rand   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index 61e807c..f2e5f33 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -64,7 +64,7 @@ fi
 f()
 {
   sed 's/ [a-z,][a-z,]*$//' $@ \
-    | awk '/^ *[0-9]/ {printf "%d %d ", $2, (NF<5 ? $NF : $5) } END {print ""}'
+    | $AWK '/^ *[0-9]/ {printf "%d %d ", $2, (NF<5 ? $NF : $5) } END {print 
""}'
 }

 for i in $(seq 1 2 21); do
diff --git a/tests/init.cfg b/tests/init.cfg
index 2e43c16..c1cb92f 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -183,7 +183,7 @@ require_file_system_bytes_free_()
 {
   local req=$1
   local expr=$(stat -f --printf "$req / %S <= %a" .)
-  awk "BEGIN{ exit !($expr) }" \
+  $AWK "BEGIN{ exit !($expr) }" \
     || skip_ "this test needs at least $req bytes of free space"
 }

diff --git a/tests/misc/sort-rand b/tests/misc/sort-rand
index 79730e9..1782a9a 100755
--- a/tests/misc/sort-rand
+++ b/tests/misc/sort-rand
@@ -35,7 +35,7 @@ compare in out1 || { fail=1; echo "not a permutation" 1>&2; }

 # If locale is available then use it to find a random non-C locale.
 if (locale --version) > /dev/null 2>&1; then
-  locale=$(locale -a | sort --random-sort | awk '/^.._/{print;exit}')
+  locale=$(locale -a | sort --random-sort | $AWK '/^.._/{print;exit}')
   LC_ALL=$locale sort --random-sort in > out1 || fail=1
   LC_ALL=$locale sort --random-sort in > out2 || fail=1

--
1.7.10.2.520.g6a4a482



reply via email to

[Prev in Thread] Current Thread [Next in Thread]