shell
rv = shell(s, false);
shell(s, true); /* doesn't return */
i = shell(s, false);
r = shell(s, false);
int shell ARGS((Source *volatile, int volatile));
const char *shell;
sp = getservbyname(shell = "shell", "tcp");
errx(1, "%s/tcp: unknown service", shell);
shell = login_getcapstr(lc, "shell", pw->pw_shell,
shell = pw->pw_shell;
if (strcmp(shell, PATH_AUTHPF_SHELL)) {
if (shell != pw->pw_shell)
free(shell);
if (shell != pw->pw_shell)
free(shell);
char *shell;
if ((shell = getenv("SHELL")) != NULL && *shell != '\0')
cmd = shell;
shell, cmd);
char *shell;
char *shell, *base;
if ((shell = getenv("SHELL")) != NULL)
base = strrchr(shell, '/');
base = shell;
(void)execl(shell, base, (char *) 0);
md_shell(const char *shell)
execl(shell, shell, (char *)NULL);
char *shell = getenv("SHELL");
if (!*shell)
shell = "/bin/sh";
execl(shell,shell,0);
const char *cp, *shell;
if ((shell = pw->pw_shell) == NULL || *shell == 0)
shell = _PATH_BSHELL;
if (strcmp(cp, shell) == 0)
(void)strlcat(shell, pwd->pw_shell, sizeof(shell));
static char shell[PATH_MAX + 1] = "SHELL=";
static char *envinit[] = { homedir, shell, path, username, logname, 0 };
const char *shell = INIT_BSHELL;
"Enter pathname of shell or RETURN for %s: ", shell);
shell = altshell;
(void)execv(shell, __UNCONST(argv));
emergency("can't exec `%s' for single user: %m", shell);
static const char *name, *shell;
if (shell == NULL) {
if ((shell = getenv("SHELL")) == NULL)
shell = _PATH_BSHELL;
if ((name = strrchr(shell, '/')) == NULL)
name = shell;
(void)execl(shell, name, "-c", command, (char *)NULL);
warn("%s", shell);
char *shell; /* user's shell */
(void)printf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL);
pn->shell = strdup(pw->pw_shell);
{ "!", H(shellhelp), 0, 0, 0, CMPL0 shell },
void shell(int, char **);
char *shell = NULL;
if ((shell = login_getcapstr(lc, "shell", NULL, NULL)) != NULL) {
if ((shell = strdup(shell)) == NULL) {
pwd->pw_shell = shell;
char *shell = NULL;
shell = login_getcapstr(lc, "shell", pwd->pw_shell, pwd->pw_shell);
if (*shell == '\0')
shell = pwd->pw_shell;
if ((pwd->pw_shell = strdup(shell)) == NULL) {
{ "!", shell, 0, CMP(xF) T|I|STRLIST, 0, 0 },
(void)shell(&linebuf[2]);
int shell(void *);
(void)shell(cp + 1);
escCmd = shell->hasErrCtl ? NULL : EscapeShellDblQuot(xcmd);
if (job->echo && run && shell->hasEchoCtl)
else if (shell->hasErrCtl)
if (!shell->hasErrCtl && shell->runChkTmpl != NULL &&
shell->runChkTmpl[0] != '\0') {
cmdTemplate = escCmd[0] == shell->commentChar ||
? shell->runIgnTmpl
: shell->runChkTmpl;
if ((shell->errFlag != NULL && shell->errFlag[0] != '-') ||
(shell->echoFlag != NULL && shell->echoFlag[0] != '-')) {
!job->ignerr && shell->errFlag != NULL
? shell->errFlag : "",
job->echo && shell->echoFlag != NULL
? shell->echoFlag : "");
if (!job->ignerr && shell->errFlag != NULL) {
argv[argc] = UNCONST(shell->errFlag);
if (job->echo && shell->echoFlag != NULL) {
argv[argc] = UNCONST(shell->echoFlag);
if (shell->noPrint == NULL || shell->noPrint[0] == '\0')
while ((ep = strstr(p, shell->noPrint)) != NULL && ep < endp) {
p = ep + shell->noPrintLen;
shellName = shell->name;
if (shell->errFlag == NULL)
shell->errFlag = "";
if (shell->echoFlag == NULL)
shell->echoFlag = "";
if (shell->hasErrCtl && shell->errFlag[0] != '\0') {
strcmp(shell->errFlag, &shellErrFlag[1]) != 0) {
shellErrFlag = str_concat2("-", shell->errFlag);
return shell->newline;
shell = sh;
shell = sh;
shell = bmake_malloc(sizeof *shell);
*shell = newShell;
if (shell->echoOn != NULL && shell->echoOff != NULL)
shell->hasEchoCtl = true;
if (!shell->hasErrCtl) {
if (shell->echoTmpl == NULL)
shell->echoTmpl = "";
if (shell->runIgnTmpl == NULL)
shell->runIgnTmpl = "%s\n";
static Shell *shell = &shells[DEFSHELL_INDEX];
if (shell->hasEchoCtl)
ShellWriter_WriteLine(wr, shell->echoOff);
ShellWriter_WriteFmt(wr, shell->echoTmpl, escCmd);
if (shell->hasEchoCtl)
ShellWriter_WriteLine(wr, shell->echoOn);
ShellWriter_WriteLine(wr, shell->errOff);
ShellWriter_WriteLine(wr, shell->errOn);
*inout_cmdTemplate = shell->runIgnTmpl;
else if (shell->hasErrCtl)
else if (shell->runIgnTmpl != NULL && shell->runIgnTmpl[0] != '\0') {
shell = getenv("SHELL");
if (shell != NULL)
pwd->pw_shell = shell;
shell = pwd->pw_shell;
shell = sbuf;
(void)execl(pwd->pw_shell, shell, NULL);
char *shell, sbuf[MAXPATHLEN + 2];
char *shell;
shell = x_basename(ptr);
if (!strcmp(shell_list[i].name, shell)) {
const char *shell;
shell = getenv("SHELL");
if (shell == NULL)
shell = _PATH_BSHELL;
execl(shell, shell, "-i", NULL);
warn("execl `%s'", shell);
const char *user, *shell, *avshell;
shell = class = NULL;
shell = shellbuf;
shell = _PATH_BSHELL;
shell = pwd->pw_shell;
shell = _PATH_BSHELL;
if ((p = strrchr(shell, '/')) != NULL)
avshell = shell;
(void)setenv("SHELL", shell, 1);
(void)execv(shell, np);
err(EXIT_FAILURE, "%s", shell);
const char *user, *shell, *avshell;
shell = class = NULL;
shell = shellbuf;
shell = _PATH_BSHELL;
shell = pwd->pw_shell;
shell = _PATH_BSHELL;
if ((p = strrchr(shell, '/')) != NULL)
avshell = shell;
(void)setenv("SHELL", shell, 1);
(void)execv(shell, np);
err(EXIT_FAILURE, "%s", shell);
{ "!", shellhelp, shell, 0 },
int shell(int, char *[]);
{ '!', NORM, "shell", shell },
void shell(char);
const char *shell;
if ((shell = getenv("SHELL")) == NULL)
shell = _PATH_BSHELL;
execlp(shell, shell, "-i", NULL);
err(1, "%s", shell);