diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 38df18daeb2..b004b9bd510 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -371,3 +371,8 @@ sed -i "s/color_code='0;31;42'/color_code='31;42'/" tests/ls/quote-align.sh # Slightly different error message sed -i 's/not supported/unexpected argument/' tests/mv/mv-exchange.sh +# Most tests check that `/usr/bin/tr` is working correctly before running. +# However in NixOS/Nix-based distros, the tr coreutil is located somewhere in +# /nix/store/xxxxxxxxxxxx...xxxx/bin/tr +# We just replace the references to `/usr/bin/tr` with the result of `$(which tr)` +sed -i 's/\/usr\/bin\/tr/$(which tr)/' tests/init.sh