简体   繁体   中英

Invoking a C executable with two parameters from a Script

I want to invoke a C executable with two arguments both of type string from a script. Am working with busybox shell. There is a script that is called whenever a USB device is plugged. Now I want to invoke my C executable from that script. I tried calling it with /usr/bin/myExecutable param1 param2 & but no use. It is not being called. How can I invoke the C executable from the busybox shell script?

There could be many reasons behind this. I mean what myExecutable program does. Does it print something on the standard output(terminal)or this program is written to do some background job.

In any case we can check the status of the last command executed under shell. shell store the information in the special variable $?. If the last command was successful it would return 0 otherwise it would return >0.

If possible, please share the output of the following command from your machine.

$/usr/bin/myExecutable param1 param2 &

$echo $?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM