Lines Matching refs:shell
32 /* Default shell to use. */
49 /* The default shell is a pointer so we can change it if Makefile
222 /* Non-zero if we use a *real* shell (always so on Unix). */
332 /* returns whether path is assumed to be a unix like shell. */
366 return 0; /* not a unix shell */
370 /* in doubt assume a unix like shell */
467 We have at least one child outstanding OR a shell function in progress,
677 /* Check if this is the child of the `shell' function. */
680 /* It is. Leave an indicator for the `shell' function. */
1104 so avoid forking a useless shell. Do this after we increment
1306 /* We call `system' to do the job of the SHELL, since stock DOS
1307 shell is too dumb. Our `system' knows how to handle long
1319 /* If we have a *real* shell, tell `system' to call
1323 /* A *real* shell on MSDOS may not support long
1325 cmdline = argv[2]; /* get past "shell -c" */
2079 /* the file might have a strange shell extension */
2098 /* The file is not executable. Try it as a shell script. */
2100 char *shell;
2106 /* Do not use $SHELL from the environment */
2107 struct variable *p = lookup_variable ("SHELL", 5);
2109 shell = p->value;
2111 shell = 0;
2113 shell = getenv ("SHELL");
2115 if (shell == 0)
2116 shell = default_shell;
2128 new_argv[0] = shell;
2147 pid = spawnvpe (P_NOWAIT, shell, new_argv, envp);
2151 execvp (shell, new_argv);
2154 error (NILF, _("%s: Shell program not found"), shell);
2156 perror_with_name ("execvp: ", shell);
2196 avoid using a shell. This routine handles only ' quoting, and " quoting
2200 is the first word of a line, the shell is used.
2205 SHELL is the shell to use, or nil to use the default shell.
2209 construct_command_argv_internal (char *line, char **restp, char *shell,
2213 /* MSDOS supports both the stock DOS shell and ports of Unixy shells.
2215 because DOS shells are too dumb. When $SHELL points to a real
2216 (unix-style) shell, `system' just calls it to do everything. When
2217 $SHELL points to a DOS shell, `system' does most of the work
2218 internally, calling the shell only for its internal commands.
2226 The shell wildcard characters are in DOS_CHARS because they will
2350 if (shell == 0)
2351 shell = default_shell;
2353 else if (strcmp (shell, default_shell))
2355 char *s1 = _fullpath(NULL, shell, 0);
2369 else if (stricmp (shell, default_shell))
2373 DB (DB_BASIC, (_("$SHELL changed (was `%s', now `%s')\n"),
2374 default_shell, shell));
2375 unixy_shell = _is_unixy_shell (shell);
2376 /* we must allocate a copy of shell: construct_command_argv() will free
2377 * shell after this function returns. */
2378 default_shell = xstrdup (shell);
2398 else if (strcmp (shell, default_shell))
2439 For DOS/Windows/OS2, if we don't have a POSIX shell,
2488 shell flags. */
2497 We're in the fastpath, so emulate what the shell would do. */
2579 see if it is a built-in shell command.
2580 If so, have the shell handle it. */
2609 /* Let the shell deal with an unterminated quote. */
2638 /* We must use the shell. */
2648 execute_by_shell = 1; /* actually, call `system' if shell isn't unixy */
2685 * which gave the shell fits. I think we have to eat
2697 /* SHELL may be a multi-word command. Construct a command line
2698 "SHELL -c LINE", with all special chars in LINE escaped.
2702 unsigned int shell_len = strlen (shell);
2720 bcopy (shell, ap, shell_len);
2736 shell on DOS/Windows/OS2, mimic the pre-POSIX behavior
2815 new_argv[0] = xstrdup (shell);
2832 We use line here instead of new_line because we run the shell
2865 Note: if we do not allow cmd to be the default shell
2880 /* Let the shell decide what to do. Put the command line into the
2882 size_t sh_len = strlen (shell);
2886 /* Exactly strlen(shell) + strlen("/c") + strlen(line) + 3 times
2889 memcpy (new_argv[0], shell, sh_len + 1);
2912 fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"),
2923 avoid using a shell. This routine handles only ' quoting, and " quoting
2927 is the first word of a line, the shell is used.
2933 variable expansion for $(SHELL) and $(IFS). */
2939 char *shell, *ifs;
2984 /* Turn off --warn-undefined-variables while we expand SHELL and IFS. */
2988 shell = allocated_variable_expand_for_file ("$(SHELL)", file);
2994 if (shell) {
2995 char *p = w32ify (shell, 0);
2996 strcpy (shell, p);
3012 /* if we have an unixroot drive and if shell is not default_shell
3014 performed) and if shell is an absolute path without drive letter,
3017 if (unixroot && shell && strcmp (shell, last_shell) != 0
3018 && (shell[0] == '/' || shell[0] == '\\'))
3020 /* trying a new shell, check whether it exists */
3021 size_t size = strlen (shell);
3023 memcpy (buf, shell, size);
3025 if (access (shell, F_OK) != 0 && access (buf, F_OK) != 0)
3032 /* we have found a shell! */
3033 /* free(shell); */
3034 shell = buf;
3049 argv = construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr);
3051 free (shell);