From c0e76b8f267c3185e20bd24dab9f118f18bc0553 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 7 Nov 2023 11:28:18 +0100 Subject: [PATCH] More robust zcat --- bin/zcat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/zcat b/bin/zcat index 715d4842..7ccecf07 100755 --- a/bin/zcat +++ b/bin/zcat @@ -16,7 +16,8 @@ with gzip.open("$1", "rt") as f: EOF fi else - command=$(which -a zcat | grep -v 'qp2/bin/' | head -1) + SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" + command=$(which -a zcat | grep -v "$SCRIPTPATH/" | head -1) exec $command $@ fi