Siteshwar Vashisht b316f7
diff --git a/execute_cmd.h b/execute_cmd.h
Siteshwar Vashisht b316f7
--- a/execute_cmd.h
Siteshwar Vashisht b316f7
+++ b/execute_cmd.h
Siteshwar Vashisht b316f7
@@ -37,6 +37,9 @@ struct func_array_state
Siteshwar Vashisht b316f7
   };
Siteshwar Vashisht b316f7
 #endif
Siteshwar Vashisht b316f7
 
Siteshwar Vashisht b316f7
+/* Variables delared in execute_cmd.c, used by many other files */
Siteshwar Vashisht b316f7
+extern int executing_command_builtin;
Siteshwar Vashisht b316f7
+
Siteshwar Vashisht b316f7
 extern struct fd_bitmap *new_fd_bitmap __P((int));
Siteshwar Vashisht b316f7
 extern void dispose_fd_bitmap __P((struct fd_bitmap *));
Siteshwar Vashisht b316f7
 extern void close_fd_bitmap __P((struct fd_bitmap *));
Siteshwar Vashisht b316f7
diff --git a/subst.c b/subst.c
Siteshwar Vashisht b316f7
--- a/subst.c
Siteshwar Vashisht b316f7
+++ b/subst.c
Siteshwar Vashisht b316f7
@@ -10676,11 +10676,12 @@ expand_word_list_internal (list, eflags)
Siteshwar Vashisht b316f7
 		  tint = do_word_assignment (temp_list->word, 0);
Siteshwar Vashisht b316f7
 		  this_command_name = savecmd;
Siteshwar Vashisht b316f7
 		  /* Variable assignment errors in non-interactive shells
Siteshwar Vashisht b316f7
-		     running in Posix.2 mode cause the shell to exit. */
Siteshwar Vashisht b316f7
+		     running in Posix.2 mode cause the shell to exit, unless 
Siteshwar Vashisht b316f7
+		     they are being run by the `command' builtin. */
Siteshwar Vashisht b316f7
 		  if (tint == 0)
Siteshwar Vashisht b316f7
 		    {
Siteshwar Vashisht b316f7
 		      last_command_exit_value = EXECUTION_FAILURE;
Siteshwar Vashisht b316f7
-		      if (interactive_shell == 0 && posixly_correct)
Siteshwar Vashisht b316f7
+		      if (interactive_shell == 0 && posixly_correct && executing_command_builtin == 0)
Siteshwar Vashisht b316f7
 			exp_jump_to_top_level (FORCE_EOF);
Siteshwar Vashisht b316f7
 		      else
Siteshwar Vashisht b316f7
 			exp_jump_to_top_level (DISCARD);