Here I want to find out the status of the last call to system() .
I have one script file containing
hciconfig hci0 &> /dev/null if [ "$?" -ne 0 ]; then . ./$BT_CLEAN
I want to do the same in a C program, so I used system() to run the hciconfig hci0 &> /dev/null command. But how can I find out the status of this executed team? In the shell script, we used "$?" same thing here In C: How can I find out if the last command was successful or not?
I used system("hciconfig hci0 &> /dev/null") in C.
source share