B
blackbug
I am trying to write a small code which uses unix commands
i am using the system() function call to execute the commands.
but this will just execute them and would return back true or false,
what if i need to feed the output generated by executing command in
the variables of my c++ program?
example:
system("ls | wc -l");
this would return the number of output rows, for eg say number of rows
are 6.
and now i want to use this number '6' as a value to any variable in my
c++ code.
Please let me know if anyone know solution for this.
Also, I was looking for some c++/c implementation of some unix
commands, if we can find them.
Thanks
regards,
KK
i am using the system() function call to execute the commands.
but this will just execute them and would return back true or false,
what if i need to feed the output generated by executing command in
the variables of my c++ program?
example:
system("ls | wc -l");
this would return the number of output rows, for eg say number of rows
are 6.
and now i want to use this number '6' as a value to any variable in my
c++ code.
Please let me know if anyone know solution for this.
Also, I was looking for some c++/c implementation of some unix
commands, if we can find them.
Thanks
regards,
KK