How to save the output of ifconfig command into a buffer?
问题 I have to save the output of the command "ifconfig" into a char buffer using C++ and VxWorks. How can I do it? 回答1: ifconfig is a shell command, so you should be able to redirect its output to a file using '>' and then read that file. You can also have a look at the topic 'Redirecting Shell IO' in the manual. 回答2: Here is an example using pipe to save the output of ifconfig into a buffer. Try -> pipe_test and -> puts &pipe_buf on the C interpreter shell. Good luck. char pipe_buf[128*256]; int