Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system/exec output

Status
Not open for further replies.

simanek

Programmer
Jan 19, 2001
137
US
hi all,

i know that if i use the system or exec functions i can execute a command quite easily. the problem for me is that i need the output produced by the command I execute (i.e. vmstat, iostat, prtdiag, etc.). does anyone know of a trick to get the output from a system call?
thanks much.
Mike
~~~~
simanek@uiuc.edu
"It's a Swingline!"
~~~~
 
There are two ways (I know of) to get the output

Use backticks:

@dir = `dir`;print @dir;

Use a pipe:

open(OUT,"dir|");

@dir = <OUT>;

print @dir;

AD AUGUSTA PER ANGUSTA

Thierry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top