FDOS / freecom

FreeDOS Command Shell (command.com)
http://www.freedos.org/
GNU General Public License v2.0
155 stars 38 forks source link

support for escaped characters #12

Closed codercowboy closed 5 years ago

codercowboy commented 6 years ago

I'd like to see support for escaped characters, particularly in the echo command.

Per this guide, for example, to display a ">", the usual command would be "echo ^>".

I'm happy to help. How would I go about adding support for this to the shell? I dug around a little in command.c in an attempt to find the bit of code that handles the ">" for redirection, but didn't find anything super obvious quickly, so a pointer would be helpful.

bartoldeman commented 5 years ago

This was a three line change, so I just did it.

codercowboy commented 5 years ago

Thanks! To be clear, the resource I linked above lists a few more escapable characters in the table below such as &&, ^^, ^<, ^( and so on. The ">" escaped character is the one I wanted for my uses though, so thanks again!

bartoldeman commented 5 years ago

Yes the thing is that it's not necessary for the others since freecom does not support &, && etc, so echo & already shows an &, and echo ^& gives ^&. Then it's just a question which command interpreter you want to be compatible with.

codercowboy commented 5 years ago

Ah, good point! Thanks so much for the fix.