For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

estradjs_130284's avatar
estradjs_130284
Icon for Nimbostratus rankNimbostratus
Oct 17, 2013

TCL issue with "backslash substitution"

Hello all, I am having a problem using an iApp while reading some parameters. In my presentation section, I have a table and the issue comes when parsing the elements. I get them using the "lindex" command. The problem here is that due to the backslash substitution parameters such as "\myserver\my_path" are not propperly read (in this case, the result would be "\myservermypath"). As far as I know, the lindex command makes this substitutions, and there is not another way to parse the elements of a table, as this is actually a TCL list. An easy example would be, having a list like this set mylist {"\myserver\mypath" "foo" "bar"} puts [something_like_lindex $mylist 0]

 

And print exactly \myserver\mypath Any ideas about this? Thanks in advance for your help

 

2 Replies

  • Fred_Slater_856's avatar
    Fred_Slater_856
    Historic F5 Account

    Escape the backslashes with backslashes, using string map. For example, [string map {\\ \\\\} $foo].

     

  • Thanks for your answer Fred, Your solution works for the \ problem, but I still have the same problem with single backslashes. The ideal should be [string map {\ \} $foo} but this doesn't work. I have also tried with subst and it didn't work neither. I think the only solution for this is a regular expresion (regsub) to substitute the backslash plus any letter for a double backslash plus the same letter.