Do you have a question? Post it now! No Registration Necessary
- Posted on
March 11, 2009, 2:37 am
rate this thread
Re: How to excute shell command and return result string ?
system(3) is the high level version that runs the command
via a shell for full shell redirection, etc.
That sets up the pipes (file redirection) that the exec(2) family won't:
you'd have to dup() stdout before exec() to get the output.
Agreed, use the direct functions when possible
(no need for fork/exec other processes just to get the parameters,
works faster too), but is more work for the programmer.
- » UK Embedded Masterclass - 7th and 12th May - Cambridge and Bristol
- — Previous thread in » Embedded Linux
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
- » [CHARTER] handvest nl.hobby.elektronica [maandelijks bericht, maart 2021]
- — The site's Newest Thread. Posted in » Electronics (Dutch)