[PATCH] selftests: use 'head -n' option handling on shell scripts

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

 



This patch changes old option syntax 'head -1' calls to 'head -n 1'
as this seems to fit also other implementations of 'head' beside the
one on coreutils.

Signed-off-by: Fabian Godehardt <fg@xxxxxxxxx>
---
 tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh    | 4 ++--
 tools/testing/selftests/ftrace/ftracetest                 | 2 +-
 tools/testing/selftests/memory-hotplug/mem-on-off-test.sh | 4 ++--
 tools/testing/selftests/rcutorture/bin/kvm-recheck.sh     | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
index 98b1d65..1ce7911 100755
--- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
+++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
@@ -13,7 +13,7 @@ prerequisite()
 
 	taskset -p 01 $$
 
-	SYSFS=`mount -t sysfs | head -1 | awk '{ print $3 }'`
+	SYSFS=`mount -t sysfs | head -n 1 | awk '{ print $3 }'`
 
 	if [ ! -d "$SYSFS" ]; then
 		echo $msg sysfs is not mounted >&2
@@ -210,7 +210,7 @@ done
 # Test with cpu notifier error injection
 #
 
-DEBUGFS=`mount -t debugfs | head -1 | awk '{ print $3 }'`
+DEBUGFS=`mount -t debugfs | head -n 1 | awk '{ print $3 }'`
 NOTIFIER_ERR_INJECT_DIR=$DEBUGFS/notifier-error-inject/cpu
 
 prerequisite_extra()
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index da48812..483564c 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -87,7 +87,7 @@ parse_opts() { # opts
 }
 
 # Parameters
-DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -1`
+DEBUGFS_DIR=`grep debugfs /proc/mounts | cut -f2 -d' ' | head -n 1`
 TRACING_DIR=$DEBUGFS_DIR/tracing
 TOP_DIR=`absdir $0`
 TEST_DIR=$TOP_DIR/test.d
diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
index 6cddde0..1a32a0c 100755
--- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
+++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
@@ -11,7 +11,7 @@ prerequisite()
 		exit 0
 	fi
 
-	SYSFS=`mount -t sysfs | head -1 | awk '{ print $3 }'`
+	SYSFS=`mount -t sysfs | head -n 1 | awk '{ print $3 }'`
 
 	if [ ! -d "$SYSFS" ]; then
 		echo $msg sysfs is not mounted >&2
@@ -177,7 +177,7 @@ done
 # Test with memory notifier error injection
 #
 
-DEBUGFS=`mount -t debugfs | head -1 | awk '{ print $3 }'`
+DEBUGFS=`mount -t debugfs | head -n 1 | awk '{ print $3 }'`
 NOTIFIER_ERR_INJECT_DIR=$DEBUGFS/notifier-error-inject/memory
 
 prerequisite_extra()
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index d86bdd6..200ac2b 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -36,7 +36,7 @@ do
 		then
 			firsttime=""
 			resdir=`echo $i | sed -e 's,/$,,' -e 's,/[^/]*$,,'`
-			head -1 $resdir/log
+			head -n 1 $resdir/log
 		fi
 		TORTURE_SUITE="`cat $i/../TORTURE_SUITE`"
 		kvm-recheck-${TORTURE_SUITE}.sh $i
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux