<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Is there a way to send shell commands from a script instead of manually typing them when using KSDK1.2.0 shell interface in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Is-there-a-way-to-send-shell-commands-from-a-script-instead-of/m-p/477330#M15713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using shell MQX task to get the commands from serial port on FRDM-K22F board but I am unable to figure out how to automate this. I can manually type in the command and shell interface compares the command with the list I provided in SHELL_COMMAND_STRUCT but I would like to be able to send these commands using a script. I am currently using putty to type the commands but even if I use plink (which is a command line tool for putty), I still get the same shell interface and I couldn't figure out how I can automate this. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/1791i1D7C193DDB6F10E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Mar 2016 18:51:24 GMT</pubDate>
    <dc:creator>roseersin</dc:creator>
    <dc:date>2016-03-14T18:51:24Z</dc:date>
    <item>
      <title>Is there a way to send shell commands from a script instead of manually typing them when using KSDK1.2.0 shell interface</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Is-there-a-way-to-send-shell-commands-from-a-script-instead-of/m-p/477330#M15713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using shell MQX task to get the commands from serial port on FRDM-K22F board but I am unable to figure out how to automate this. I can manually type in the command and shell interface compares the command with the list I provided in SHELL_COMMAND_STRUCT but I would like to be able to send these commands using a script. I am currently using putty to type the commands but even if I use plink (which is a command line tool for putty), I still get the same shell interface and I couldn't figure out how I can automate this. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/1791i1D7C193DDB6F10E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2016 18:51:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Is-there-a-way-to-send-shell-commands-from-a-script-instead-of/m-p/477330#M15713</guid>
      <dc:creator>roseersin</dc:creator>
      <dc:date>2016-03-14T18:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to send shell commands from a script instead of manually typing them when using KSDK1.2.0 shell interface</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Is-there-a-way-to-send-shell-commands-from-a-script-instead-of/m-p/477331#M15714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rose,&lt;/P&gt;&lt;P&gt;A method to input Shell command via "C" code is below:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14580539323068414" data-renderedposition="60_8_1192_496" jivemacro_uid="_14580539323068414"&gt;&lt;P&gt;void my_task(uint_32)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; char_ptr&amp;nbsp;&amp;nbsp; ARGV[4];&lt;/P&gt;&lt;P&gt;&amp;nbsp; char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CMD_LINE[40]="copy a:\\test.txt c:\\my.txt";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* create lwevent group */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_lwevent_create(&amp;amp;lwevent_FS,0) != MQX_OK) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("\nMake event failed");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(TRUE)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snprintf(CMD_LINE, 28, "copy a:\\test.txt c:\\my.txt");&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (_lwevent_wait_ticks(&amp;amp;lwevent_FS,0b11,TRUE,0) != MQX_OK) &lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("\nEvent Wait failed");&lt;/P&gt;&lt;P&gt;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("\nbefore copying\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("%s",CMD_LINE);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Shell_parse_command_line(CMD_LINE, ARGV);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Shell_copy(3, ARGV);&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf("\nafter copying\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (_lwevent_clear(&amp;amp;lwevent_FS,0b11) != MQX_OK) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("\nEvent Clear failed");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 14:59:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Is-there-a-way-to-send-shell-commands-from-a-script-instead-of/m-p/477331#M15714</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-03-15T14:59:03Z</dc:date>
    </item>
  </channel>
</rss>

