riscv-openocd icon indicating copy to clipboard operation
riscv-openocd copied to clipboard

how to escape the double quote of the command we send to capture command

Open quantrpeter opened this issue 5 years ago • 4 comments

hi we can send capture "command" to tcl port. If the command contains double quote, how to escape it? I tried changing " to " , not working Thanks Peter

quantrpeter avatar Aug 08 '20 14:08 quantrpeter

What is the capture command? What commands have a " in them? Do you have a specific example with more details of what you're doing?

timsifive avatar Aug 11 '20 17:08 timsifive

i am sending the command via tcl port, not telnet. Some command need to use "capture", such as

capture "ocd_reg"

If pass the tcl statment to capture, such as echo "peter", then i need to escape the double quote. But i don't know how to

Thanks Peter

quantrpeter avatar Aug 12 '20 08:08 quantrpeter

I see. I haven't used the TCL port for anything. You might try asking about this on the regular openocd user mailing list.

timsifive avatar Aug 12 '20 19:08 timsifive

This seems like a generic TCL string escaping issue (not related just to the "TCL port" of OpenOCD).

@quantrpeter - The following suggestion has worked for me - escape curly braces ({ and }) in your original string, then wrap your string into a pair of curly braces: https://stackoverflow.com/questions/5302120/general-string-quoting-for-tcl/5302213#5302213

If the problems persists, please try asking on openocd-user mail list: http://openocd.org/discussion/mailing-lists/

JanMatCodasip avatar Aug 13 '20 05:08 JanMatCodasip

@quantrpeter, are you OK with the provided resolution? I would like to close the issue.

en-sc avatar Jan 22 '24 16:01 en-sc