[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] m4sh: prefer bash over sh

From: Ross Burton
Subject: [PATCH] m4sh: prefer bash over sh
Date: Mon, 23 Mar 2020 13:20:03 +0000

From: Ross Burton <address@hidden>

_AS_DETECT_BETTER_SHELL looks for a good shell to use, and tries to look for
'sh' before 'bash'.  Whilst for many systems sh is a symlink to bash,
there are many where sh is a symlink to a more minimal sh implementation.

For example, Debian by default has /bin/sh -> /bin/dash: dash is a faster
shell to start (which makes a notable difference to boot speed) but is not
as fast as bash at executing long scripts (and configure scripts are not
known for their conciseness).

Change the search order to bash then sh, so that a known-good shell (bash)
is used if available over something which is merely POSIX compliant.
 lib/m4sugar/m4sh.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index af286857..f83a959d 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -229,7 +229,7 @@ dnl Remove any tests from suggested that are also required
       [case $as_dir in @%:@(
-          for as_base in sh bash ksh sh5; do
+          for as_base in bash sh ksh sh5; do
             # Try only shells that exist, to save several forks.
             AS_IF([{ test -f "$as_shell" || test -f "$as_shell.exe"; } &&

reply via email to

[Prev in Thread] Current Thread [Next in Thread]