From 910555cd9f3efc698af39ce23f5370bc68ef232b Mon Sep 17 00:00:00 2001 From: Cedric DEFORTIS Date: Fri, 18 Oct 2024 16:00:17 +0200 Subject: [PATCH] Fixup #44: Fixup bug when defining `ABSPATH` variable Using `cd` might cause shell to echo back new working directory (cf. issue https://github.com/flaupretre/terraform-ssh-tunnel/issues/44) Proposed solution is to redirect `cd` output to `/dev/null` --- tunnel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tunnel.sh b/tunnel.sh index 1063145..cb2ad43 100755 --- a/tunnel.sh +++ b/tunnel.sh @@ -35,7 +35,7 @@ if [ -z "$TUNNEL_TF_PID" ] ; then env >&2 fi - TUNNEL_ABSPATH=$(cd "$(dirname "$0")"; pwd -P) + TUNNEL_ABSPATH=$(cd "$(dirname "$0")" >/dev/null; pwd -P) export TUNNEL_ABSPATH query="$(dd 2>/dev/null)"