From d975ebb0171f1cf671c31d389766c53f1b7983f1 Mon Sep 17 00:00:00 2001 From: Martyn Welch <martyn.welch@collabora.co.uk> Date: Fri, 6 Jul 2018 10:20:45 +0100 Subject: [PATCH] Correct handling of missing .bash_history Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk> --- run-aa-test | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/run-aa-test b/run-aa-test index ad6ec39..6f8741b 100755 --- a/run-aa-test +++ b/run-aa-test @@ -60,8 +60,9 @@ TEST_TITLE=$( basename ${EXPECT_FILE} ) # Touch .bash_history, which we use in some tests, if it's not there. bash_history="/home/${CHAIWALA_USER}/.bash_history" if [ ! -r ${bash_history} ]; then - RET=$( sudo -u ${CHAIWALA_USER} touch ${bash_history} ) - if [ $RET != 0 ]; then + sudo -u ${CHAIWALA_USER} touch ${bash_history} + RET=$? + if [ "$RET" != "0" ]; then echo "Failed to create .bash_history: $RET" exit 1 fi -- GitLab