From a9d6517c4bc6398c0146c9e8f38802367e225777 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 6 Feb 2017 22:28:44 +0100 Subject: [PATCH] Improve portability there is no need to hard depend on bash given almost all the code is /bin/sh compliant Remove the function keyword from setup-source to make it /bin/sh compliant pipe wc -l output to xargs to make the command output compatible with both GNU wc and BSD wc (which prefix the output with a tab) --- tests/010-xauth-add-inet.script | 2 +- tests/020-xauth-add-local.script | 4 ++-- tests/030-xauth-extract.script | 2 +- tests/040-xauth-source.script | 2 +- tests/090-xauth-bad-usage.script | 2 +- tests/setup-sourced | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/010-xauth-add-inet.script b/tests/010-xauth-add-inet.script index 97fe2af..685cdd7 100755 --- a/tests/010-xauth-add-inet.script +++ b/tests/010-xauth-add-inet.script @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # setup the test ennvironment inside this shell . setup-sourced diff --git a/tests/020-xauth-add-local.script b/tests/020-xauth-add-local.script index 06850e3..71d0752 100755 --- a/tests/020-xauth-add-local.script +++ b/tests/020-xauth-add-local.script @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # setup the test ennvironment inside this shell . setup-sourced @@ -11,7 +11,7 @@ xauth add :3.5 . b90b0fd1cf6a0e7a2c74c00000000007 xauth add :4 . b90b0fd1cf6a0e7a2c74c00000000004 # List the number of entries added -xauth list | wc -l +xauth list | wc -l | xargs echo # Try to match them and print cookie xauth list unix:0 | awk '{print $3}' diff --git a/tests/030-xauth-extract.script b/tests/030-xauth-extract.script index 0fd0bf0..8423ff1 100755 --- a/tests/030-xauth-extract.script +++ b/tests/030-xauth-extract.script @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # setup the test ennvironment inside this shell . setup-sourced diff --git a/tests/040-xauth-source.script b/tests/040-xauth-source.script index 9909204..01c27ab 100755 --- a/tests/040-xauth-source.script +++ b/tests/040-xauth-source.script @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # setup the test ennvironment inside this shell . setup-sourced diff --git a/tests/090-xauth-bad-usage.script b/tests/090-xauth-bad-usage.script index 9f688be..8a1e2ff 100755 --- a/tests/090-xauth-bad-usage.script +++ b/tests/090-xauth-bad-usage.script @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # setup the test ennvironment inside this shell . setup-sourced diff --git a/tests/setup-sourced b/tests/setup-sourced index 2ed1a6b..e28773b 100644 --- a/tests/setup-sourced +++ b/tests/setup-sourced @@ -11,14 +11,14 @@ export XAUTHORITY=${DATADIR:-/tmp}/.Xauthority # Start a new authority file rm -f $XAUTHORITY ; touch $XAUTHORITY -function xauth() +xauth() { echo "> xauth" "$@" ../xauth "$@" echo " exits with $?" } -function xauth_silent() +xauth_silent() { echo "> xauth" "some silent commands which should not be logged..." ../xauth "$@" -- 2.11.0