casaroli opened a new pull request, #2469:
URL: https://github.com/apache/nuttx-apps/pull/2469

   ## Summary
   
   This is an attempt to refactor nsh to allow commands to have input redirects 
(`<`). It allows `<` to change the stdin descriptor when starting a nuttx task 
or to set the save/restore strucutures on the nsh handling.
   
   I am not sure if this is the correct way to achieve this, so I open this PR 
to get feedback from the community. Please let me know if there is a better way 
or if I am misunderstanding or missing something.
   
   I also prepared the ground to support `<<` style heredoc and pipes `|`. But 
those are not implemented yet.
   
   If I get positive feedback, I could implement those in this PR or in a 
future PR.
   
   ## Impact
   
   Now we can stdin and stdout redirection:
   
   ```
   nsh> echo hello > oi
   nsh> cat < oi
   hello
   nsh> cat < oi > ola
   nsh> cat ola
   hello
   nsh> echo even works the other way around > oi2
   nsh> cat > new < oi2
   nsh> cat new
   even works the other way around
   ```
   
   ## Testing
   
   Manual testing. Still need to test how it works in telnet, usb console or 
altconsole.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to