diff -c bash-2.05.orig/eval.c bash-2.05/eval.c *** bash-2.05.orig/eval.c Wed Feb 14 13:58:24 2001 --- bash-2.05/eval.c Tue Jul 24 16:19:59 2001 *************** *** 136,142 **** executing = 1; stdin_redir = 0; ! execute_command (current_command); exec_done: if (current_command) --- 136,145 ---- executing = 1; stdin_redir = 0; ! if (execute_command (current_command) != EXECUTION_SUCCESS && ! print_nonzero_exit_values) { ! printf("Exit %d\n", last_command_exit_value); ! } exec_done: if (current_command) diff -c bash-2.05.orig/flags.c bash-2.05/flags.c *** bash-2.05.orig/flags.c Wed Feb 14 13:58:48 2001 --- bash-2.05/flags.c Tue Jul 24 16:21:54 2001 *************** *** 147,152 **** --- 147,156 ---- int brace_expansion = 1; #endif + /* Non-zero means that anytime a toplevel command returns a nonzero value, + we print that exit value. It's like tcsh's "printexitvalue" option. */ + int print_nonzero_exit_values = 0; + /* **************************************************************** */ /* */ /* The Flags ALIST. */ *************** *** 193,198 **** --- 197,204 ---- #if defined (BANG_HISTORY) { 'H', &history_expansion }, #endif /* BANG_HISTORY */ + + { 'X', &print_nonzero_exit_values }, {0, (int *)NULL} }; *************** *** 318,321 **** --- 324,329 ---- #if defined (RESTRICTED_SHELL) restricted = 0; #endif + + print_nonzero_exit_values = 0; } diff -c bash-2.05.orig/flags.h bash-2.05/flags.h *** bash-2.05.orig/flags.h Thu Aug 5 04:06:26 1999 --- bash-2.05/flags.h Tue Jul 24 16:19:11 2001 *************** *** 45,51 **** just_one_command, unbound_vars_is_error, echo_input_at_read, echo_command_at_execute, no_invisible_vars, noclobber, hashing_enabled, forced_interactive, privileged_mode, ! asynchronous_notification, interactive_comments, no_symbolic_links; #if 0 extern int lexical_scoping; --- 45,52 ---- just_one_command, unbound_vars_is_error, echo_input_at_read, echo_command_at_execute, no_invisible_vars, noclobber, hashing_enabled, forced_interactive, privileged_mode, ! asynchronous_notification, interactive_comments, no_symbolic_links, ! print_nonzero_exit_values; #if 0 extern int lexical_scoping;