POSIX says grep exit code should be 2 (or greater) when an error occurs. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html * 0 One or more lines were selected. * 1 No lines were selected. * >1 An error occurred. That's how GNU grep behaves: $ grep '\(' /etc/passwd; echo $? grep: Unmatched ( or \( 2 But Busybox is currently returning 1, which is the exit code we rely to check if the pattern not matched: / # grep '\(' /etc/passwd; echo $? grep: bad regex '\(': Missing ')' 1 Could you please make it return 2 in case of errors?
Fixed in git, thanks!