<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Eddie,<div>Sure. Below is the call, the end result should be a file containing the output from the shell command. </div><div>Let me know if you need more details, I pulled this from our OS abstraction layer ( <a href="http://osal.sf.net">osal.sf.net</a> )</div><div><br></div><div>Alan</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(214, 43, 36); "><span style="color: #7a482f">#include </span><rtems/shell.h></div><div><br></div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> <span style="color: #008326">/*</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 131, 38); "> ** Spawn a task to execute the shell command</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 131, 38); "> */</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> rtemsRc = rtems_shell_script ( </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> <span style="color: #d62b24">"RSHL"</span>, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> OS_SHELL_CMD_TASK_STACK_SIZE, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> OS_SHELL_CMD_TASK_PRIORITY, </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> OS_SHELL_CMD_INPUT_FILE_NAME,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> outputFileName,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 131, 38); "><span style="color: #000000"> </span><span style="color: #bf2e9d">FALSE</span><span style="color: #000000">, </span>/* Do not append output to file */</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(0, 131, 38); "><span style="color: #000000"> </span><span style="color: #bf2e9d">TRUE</span><span style="color: #000000">, </span>/* Wait for shell task to complete */</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> <span style="color: #bf2e9d">FALSE</span> <span style="color: #008326">/* Echo output */</span> </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "> );</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px"> <br class="webkit-block-placeholder"></p></div><div><br></div><div><br><div><div>On Jan 27, 2012, at 5:12 AM, Eduardo Esteban wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello Alan,</div><div> </div><div>Could you please provide me an example of the use of rtems_shell_script because I was not able to find it.</div><div> </div><div>Best regards,</div><div> </div><div>Eddie<br><br></div>
<div class="gmail_quote">On 26 January 2012 19:49, Cudmore, Alan P. (GSFC-5820) <span dir="ltr"><<a href="mailto:alan.p.cudmore@nasa.gov">alan.p.cudmore@nasa.gov</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
We use the rtems_shell_script API to execute a single shell command and store the results in a file. We then downlink the file with the results.<br>
It should work with all of the commands.<br>
<span class="HOEnZb"><font color="#888888"><br>
Alan<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
On Jan 26, 2012, at 1:17 PM, Phil Smith wrote:<br>
<br>
> We're using RTEMS for ESA's Solar Orbiter and one change we need and would be<br>
> useful in general for space missions is to send the output of<br>
> rtems_stack_checker_report_usage<br>
> and<br>
> rtems_cpu_usage_report<br>
> to an array/structure instead of to printk so that the results can be part of<br>
> regular telemetry.<br>
><br>
> We could use rtems_stack_checker_report_usage_with_plugin and<br>
> rtems_cpu_usage_report_with_plugin and have the plugin be a function to<br>
> intercept the text and extract it ... however it would save precious (space<br>
> qualified) memory to just edit the RTEMS code.<br>
><br>
> Is anyone else interested in this or done it already?<br>
><br>
> --<br>
> Philip J. Smith __o Dept. of Space and Climate Physics,<br>
> <a href="mailto:pjs1@mssl.ucl.ac.uk">pjs1@mssl.ucl.ac.uk</a> _'\<; Mullard Space Science Laboratory,<br>
> ((( (*)/(*) University College London.<br>
><br>
><br>
> _______________________________________________<br>
> rtems-users mailing list<br>
> <a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
> <a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
<br>
<br>
_______________________________________________<br>
rtems-users mailing list<br>
<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
</div></div></blockquote></div><br>
</blockquote></div><br></div></body></html>