Open dexterbg opened 5 years ago
Backslash quoting is not implemented (and the original microrl had no quoting at all). When I considered how to add quoting, the backslash option seemed a more difficult fit.
You can use single-quotes: vfs append 'a "little" test' /sd/test.txt
What does "remotely" mean? BufferedShell?
Just checked: output on ssh works, so seems to be BufferedShell.
Using single quotes is no option, users can enter arbitrary strings containing both quotes.
Well, we never promised bash or csh.
In ovms_webserver.cpp, ExecuteCommand() does:
BufferedShell* bs = new BufferedShell(false, verbosity);
The first argument "false" tells OvmsShell to discard anything microrl prints, such as echoes of the input characters, but also including the error message about invalid quoting. If the correct action would be for microrl to always print error messages, I could fix this by adding a separate (*error_print)() member to microrl_t and always set that one to the Print() function.
Fixed in 968bedeb74bb6f5fd04cce6b4ba949e2d3f61e3f.
Thanks for the error output, Steve. Works in all channels now.
Todo: Escaping quote chars in quoted arguments
I fixed the part that I believe was a bug. Adding another method of quoting is an enhancement to be prioritized accordingly.
Escaping quote chars in quoted arguments does not work, and the error output is not sent to the OvmsWriter:
If done remotely, the command fails silently.