<div dir="ltr"><div>I know that you are working on toysh which I'm looking forward to. In the meantime below is a patch to improve compatibility with older/odd versions of bash. This fixed a minor build issue I was having on MacOS (which was using zsh in emulated bash mode) as well as an oddball embedded SDK using a non-gnu version of bash. I believe these changes are minimal and should be safe to apply, if not I wanted to at least get them on the mailing list in case others ran into these issues.</div><div><br></div><div>- Eric<br></div><div><br></div><div>diff -ru toybox-0.8.1/scripts/make.sh toybox-0.8.1-patched/scripts/make.sh</div>--- toybox-0.8.1/scripts/make.sh        2019-05-30 02:00:04.000000000 +0100<br>+++ toybox-0.8.1-patched/scripts/make.sh        2019-06-29 13:09:40.716153286 +0100<br>@@ -151,7 +151,7 @@<br>     $KCONFIG_CONFIG > generated/config.h || exit 1<br> fi<br><br>-if [ generated/mkflags -ot scripts/mkflags.c ]<br>+if [ ! -f generated/mkflags ] || [ generated/mkflags -ot scripts/mkflags.c ]<br> then<br>   do_loudly $HOSTCC scripts/mkflags.c -o generated/mkflags || exit 1<br> fi<br>@@ -235,7 +235,7 @@<br>   ) > generated/globals.h<br> fi<br><br>-if [ generated/mktags -ot scripts/mktags.c ]<br>+if [ ! -f generated/mktags ] || [ generated/mktags -ot scripts/mktags.c ]<br> then<br>   do_loudly $HOSTCC scripts/mktags.c -o generated/mktags || exit 1<br> fi<br>@@ -248,7 +248,7 @@<br>     toys/*/*.c lib/*.c | generated/mktags > generated/tags.h<br> fi<br><br>-if [ generated/config2help -ot scripts/config2help.c ]<br>+if [ ! -f generated/config2help ] || [ generated/config2help -ot scripts/config2help.c ]<br> then<br>   do_loudly $HOSTCC scripts/config2help.c -o generated/config2help || exit 1<br> fi<br>diff -ru toybox-0.8.1/scripts/portability.sh toybox-0.8.1-patched/scripts/portability.sh<br>--- toybox-0.8.1/scripts/portability.sh 2019-05-30 02:00:04.000000000 +0100<br>+++ toybox-0.8.1-patched/scripts/portability.sh 2019-06-29 13:07:54.557626590 +0100<br>@@ -10,5 +10,5 @@<br><br> if [ -z "$SED" ]<br> then<br>-  [ ! -z "$(which gsed 2>/dev/null)" ] && SED=gsed || SED=sed<br>+  [ ! -z "$(command -v gsed 2>/dev/null)" ] && SED=gsed || SED=sed<br> fi<br></div>