/* like "system" but rips off "mv", etc.*/
/* also tries to guess if can get away with exec cmd */
type
= EASY
; /* we hope */
for (t
= s
; *t
&& type
!= HARD
; t
++) {
if ((strcmp(t
, "mv") == 0)||
(strcmp(t
, "ls") == 0) ) {
fprintf(stderr
, "Execv failed\n");
* same as library version, except that resets
* default handling of signals in child, so that
* user gets the behavior he expects.
register int (*istat
)(), (*qstat
)();
istat
= signal(SIGINT
, SIG_IGN
);
qstat
= signal(SIGQUIT
, SIG_IGN
);
if ((pid
= fork()) == 0) {
signal(SIGQUIT
, SIG_DFL
);
execl("/bin/sh", "sh", "-c", s
, 0);
while ((w
= wait(&status
)) != pid
&& w
!= -1)
while (*s
!= 0 && *s
!=' '&& *s
!= '\t')
while (*s
== ' ' || *s
== '\t')