in reply to getting the output of command in variable
I'm guessing that the reason your initial backtick attempt didn't work as expected is that the snmpset command is printing its output to STDERR rather than to STDOUT. The backtick operator only captures STDOUT from the process being run, but if the process includes a redirection of STDERR to STDOUT, you should get what you want.$cmd = "snmpset ... all those options ... 2>&1"; $x = `$cmd`;
BTW, you should not have a space inside the <code> tag; note that <c> ... </c> works too.
|
|---|