Bertramp
Bertramp

Reputation: 385

How to write and execute shell script from code in vxworks 5.5?

I've been digging a lot for an answer on how to do this. The only clue i've found is that there exists an execute() function which is mentioned in these questions, and that it was never officially a supported API call:
Redirecting to stdin in order to execute script in vxworks 6.7
Executing a script from inside code in VxWorks 6.7

I would really like to know which library to include and how to use this execute() function or alternately another way of executing shellcommands or scripts from code in vxworks 5.5

Upvotes: 0

Views: 2409

Answers (2)

JaeMann Yeh
JaeMann Yeh

Reputation: 373

You can do it in the serial driver layer. See https://stackoverflow.com/a/52863308/10481046

Upvotes: 0

nnovich-OK
nnovich-OK

Reputation: 3183

Never heard about execute(), but the best way to learn is to teach :)

Obviously execute() function is a part of shellLib. API list makes impression of being unfinished, so my guessing is that VxWorks devs didn't consider shellLib done or tested thus hiding execute().

I played a bit with this function and usage is straight forward: it accepts array of chars, parses it and executes. I bet, "target shell" feature in VxWorks is based on calling execute() for each line of user input.

Since you consider function to be unofficial, I don't expect anyone to appear in topic with clear documentation, so the best advice is to try it by yourself.

Upvotes: 1

Related Questions