From 99aaf194d91e1f608d59dfb0a2709716a04ca8c6 Mon Sep 17 00:00:00 2001 From: Maxime LUCE Date: Fri, 19 Nov 2021 15:51:26 +0100 Subject: [PATCH] fix: which -s is an illegal option When I try to execute your program on WSL2 (Ubuntu 20.04), I get the following error: ``` Illegal option -s Usage: /usr/bin/which [-a] args ``` I replaced it with: ```bash if [[ -z "$(which perl)" ]]; then #... ``` --- src/bash-rollup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bash-rollup.sh b/src/bash-rollup.sh index 6291741..4c0a6d0 100755 --- a/src/bash-rollup.sh +++ b/src/bash-rollup.sh @@ -178,7 +178,7 @@ if [[ -n "${SOURCE_ONLY}" ]]; then fi done < <(cat "${MAIN_FILE}") > "${OUT_FILE}" # Note we replace existing file if any. else # process for reals - if ! which -s perl; then + if [[ -z "$(which perl)" ]]; then echoerrandexit "Perl is required." exit 10 fi