version 1.2, 2001/02/04 15:17:00 |
version 1.3, 2001/02/04 15:32:25 |
|
|
int ret, status; |
int ret, status; |
char *shell; |
char *shell; |
pid_t pid; |
pid_t pid; |
|
|
if (!*args) |
if (!*args) |
args = NULL; |
args = NULL; |
|
|
if ((shell = getenv("SHELL")) == NULL) |
if ((shell = getenv("SHELL")) == NULL) |
shell = _PATH_BSHELL; |
shell = _PATH_BSHELL; |
|
|
|
|
debug3("Executing %s", shell); |
debug3("Executing %s", shell); |
ret = execl(shell, shell, NULL); |
ret = execl(shell, shell, NULL); |
} |
} |
fprintf(stderr, "Couldn't execute \"%s\": %s\n", shell, |
fprintf(stderr, "Couldn't execute \"%s\": %s\n", shell, |
strerror(errno)); |
strerror(errno)); |
_exit(1); |
_exit(1); |
} |
} |
|
|
error("Shell exited with status %d", WEXITSTATUS(status)); |
error("Shell exited with status %d", WEXITSTATUS(status)); |
} |
} |
|
|
void |
void |
local_do_ls(const char *args) |
local_do_ls(const char *args) |
{ |
{ |
if (!args || !*args) |
if (!args || !*args) |
|
|
if (get_pathname(&cp, path1)) |
if (get_pathname(&cp, path1)) |
return(-1); |
return(-1); |
if (*path1 == NULL) { |
if (*path1 == NULL) { |
error("You must specify a path after a %s command.", |
error("You must specify a path after a %s command.", |
cmd); |
cmd); |
return(-1); |
return(-1); |
} |
} |
|
|
if (get_pathname(&cp, path1)) |
if (get_pathname(&cp, path1)) |
return(-1); |
return(-1); |
if (*path1 == NULL) { |
if (*path1 == NULL) { |
error("You must specify a path after a %s command.", |
error("You must specify a path after a %s command.", |
cmd); |
cmd); |
return(-1); |
return(-1); |
} |
} |