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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call unix commands from within C++

Status
Not open for further replies.

scecilia

Programmer
Jul 8, 2002
35
US
Hello,

How can I invoke a unix command from within my C++ code?

Thanks,
--Cecilia
 
I got it, I need double quotes arougn exec() as in:

exec("ls -l");

Thanks,

 
Try these links for more unix process control functions. Learn the parent child relationship between processes with these various process controls:

T exec():

To fork():

To spawn():

and system():

Good luck,

norm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top