From 6adfa75491df874bb564f7bf46c52f98890c52f3 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Tue, 16 Jan 2024 12:56:33 +0100 Subject: [PATCH] don't hardcode /bin/bash in eb script, RPATH wrapper script, and run_shell_cmd --- easybuild/scripts/rpath_wrapper_template.sh.in | 2 +- easybuild/tools/run.py | 4 +++- eb | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/easybuild/scripts/rpath_wrapper_template.sh.in b/easybuild/scripts/rpath_wrapper_template.sh.in index 55c3388c5b..73eb21f0e0 100644 --- a/easybuild/scripts/rpath_wrapper_template.sh.in +++ b/easybuild/scripts/rpath_wrapper_template.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## # Copyright 2016-2023 Ghent University # diff --git a/easybuild/tools/run.py b/easybuild/tools/run.py index 0bb0d3c9f4..9ba15d1da8 100644 --- a/easybuild/tools/run.py +++ b/easybuild/tools/run.py @@ -276,7 +276,9 @@ def to_cmd_str(cmd): # (which could be dash instead of bash, like on Ubuntu, see https://wiki.ubuntu.com/DashAsBinSh) # stick to None (default value) when not running command via a shell if use_bash: - executable, shell = '/bin/bash', True + bash = shutil.which('bash') + _log.info(f"Path to bash that will be used to run shell commands: {bash}") + executable, shell = bash, True else: executable, shell = None, False diff --git a/eb b/eb index 402bb87d0a..f427c5e7e7 100755 --- a/eb +++ b/eb @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## # Copyright 2009-2023 Ghent University #