2 * push - anyone remember TOPS-20?
13 #include "bashgetopt.h"
19 extern int dollar_dollar_pid
;
20 extern int last_command_exit_value
;
29 xstatus
= EXECUTION_SUCCESS
;
30 reset_internal_getopt ();
31 while ((opt
= internal_getopt (list
, "")) != -1)
42 pid
= make_child (savestring ("push"), 0);
45 builtin_error ("cannot fork: %s", strerror (errno
));
46 return (EXECUTION_FAILURE
);
50 /* Shell variable adjustments: $SHLVL, $$, $PPID, $! */
51 adjust_shell_level (1);
52 dollar_dollar_pid
= getpid ();
55 /* Clean up job control stuff. */
56 stop_making_children ();
57 cleanup_the_pipeline ();
60 last_asynchronous_pid
= NO_PID
;
62 /* Make sure the job control code has the right values for
63 the shell's process group and tty process group, and that
64 the signals are set correctly for job control. */
65 initialize_job_control (0);
66 initialize_job_signals ();
68 /* And read commands until exit. */
70 exit_shell (last_command_exit_value
);
74 stop_pipeline (0, (COMMAND
*)NULL
);
75 xstatus
= wait_for (pid
);
81 "Create a child that is an exact duplicate of the running shell",
82 "and wait for it to exit. The $SHLVL, $!, $$, and $PPID variables",
83 "are adjusted in the child. The return value is the exit status",
88 struct builtin push_struct
= {