From 027712669973008d7330d03a2629483643ba2535 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 May 2013 12:47:17 +0200 Subject: [PATCH] Return exit code 127 if a command is not found --- modules/programs/bash/command-not-found.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/programs/bash/command-not-found.nix b/modules/programs/bash/command-not-found.nix index 4eb11d3a172..6549ba86810 100644 --- a/modules/programs/bash/command-not-found.nix +++ b/modules/programs/bash/command-not-found.nix @@ -34,9 +34,12 @@ in # Retry the command if we just installed it. if [ $? = 126 ]; then "$@" + else + return 127 fi else echo "$1: command not found" >&2 + return 127 fi } '';