diff --git a/src/builder/b-nspawn.c b/src/builder/b-nspawn.c
index 3272e91..2d289f7 100644
--- a/src/builder/b-nspawn.c
+++ b/src/builder/b-nspawn.c
@@ -443,7 +443,7 @@ static const char * const runscript_win_next =
#else
static const char * const runscript_first =
- "#!/bin/bash\n" /* use -x to see what it does for these */
+ "#!/usr/bin/env bash\n" /* use -x to see what it does for these */
#if defined(__APPLE__)
"export PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin\n"
#else
@@ -469,7 +469,7 @@ static const char * const runscript_first =
;
static const char * const runscript_next =
- "#!/bin/bash\n" /* use -x to see what it does for these */
+ "#!/usr/bin/env bash\n" /* use -x to see what it does for these */
#if defined(__APPLE__)
"export PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin\n"
#else
@@ -494,7 +494,7 @@ static const char * const runscript_next =
;
static const char * const runscript_build =
- "#!/bin/bash\n" /* use -x to see what it does for these */
+ "#!/usr/bin/env bash\n" /* use -x to see what it does for these */
#if defined(__APPLE__)
"export PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin\n"
#else
diff --git a/src/builder/b-task.c b/src/builder/b-task.c
index f966291..3c938f8 100644
--- a/src/builder/b-task.c
+++ b/src/builder/b-task.c
@@ -29,7 +29,7 @@
#include "b-private.h"
const char *git_helper_sh =
- "#!/bin/bash\n"
+ "#!/usr/bin/env bash\n"
"export PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin\n"
"set -e\n"
"echo \"git_helper_sh: starting\"\n"