literal ^ in strings
Jason Quinn wrote on Oct 25, 2012
I've noticed a issue with literal carets in strings. This arose because I was trying to use the match task in a script. I wanted to do a command like
to list all lines that begin with the number 1. This however doesn't work. I can escape the caret:
and it will work.
There are several related points. The help for match doesn't suggest the escape needs to be used for the caret. And recalling the command using the up arrow keys starts stripping away escapes until the caret-number combination is interpreted as a history recall. Not sure what the intended behaviour is here.
The history mechanism does act weird here though.
Cheers,
Jason
match "^1" myfileto list all lines that begin with the number 1. This however doesn't work. I can escape the caret:
match "\^1" myfileand it will work.
There are several related points. The help for match doesn't suggest the escape needs to be used for the caret. And recalling the command using the up arrow keys starts stripping away escapes until the caret-number combination is interpreted as a history recall. Not sure what the intended behaviour is here.
The history mechanism does act weird here though.
Cheers,
Jason
Mike Fitzpatrick wrote on Oct 25, 2012
Hi Jason,
This is a CL bug that apparent'y has been around forever, the history processing should not be done on literal strings of the command. When setting the params in epar things work as expected, otherwise the escapes are needed (but not handled properly). This will be fixed for the next update.
-Mike
This is a CL bug that apparent'y has been around forever, the history processing should not be done on literal strings of the command. When setting the params in epar things work as expected, otherwise the escapes are needed (but not handled properly). This will be fixed for the next update.
-Mike
Last post on Oct 25, 2012