I am trying to use exec(), system(), passthru() or anything to read in the output of iscsiadm -m session
, am not having much luck, and a little lost.
What I (think i) know:
iscsiadm -m session > /tmp/scsi_sess
yields an empty scsi_sess
fileWhat I need to know:
With your syntax you're catching only the stdout. You should redirect the stderr on the stdout with
iscsiadm -m session 2>&1 /tmp/scsi_sess
Remember, when you do a redirect with > file
and you still see output, that output is from stderr and not from stdout