Grigory Ilizirov
Grigory Ilizirov

Reputation: 1028

PHP, shell_exec. How to run a command with several inputs

I'm trying to access the manual of using the command man (debian).

Using this code:

$out = shell_exec("man");
echo $out;

the output is:

What manual page do you want?

How can I select a page from php code?

Upvotes: 0

Views: 46

Answers (1)

I wrestled a bear once.
I wrestled a bear once.

Reputation: 23379

man by itself doesn't do anything. You have to tell it which command you want to see the manual for. For example: man cd will show you the man page for the cd command.

For example try: echo "<pre>" . shell_exec("man cd");

Upvotes: 2

Related Questions