j_mcnally
j_mcnally

Reputation: 6968

How does shell_exec() pick which shell to use?

The question came up in another thread. Figured I would ask.

Shell Script Loop from PHP not working

Upvotes: 2

Views: 190

Answers (1)

Barmar
Barmar

Reputation: 781706

If it uses popen(), that uses /bin/sh on Linux. The man page for popen() says:

The command argument is a pointer to a null-terminated string containing a shell command line. This command is passed to /bin/sh using the -c flag; interpretation, if any, is performed by the shell.

/bin/sh is the only shell that POSIX guarantees will be available.

Upvotes: 4

Related Questions