Under Linux, "Find in Files" with a '$' character doesn't work

37 views
Skip to first unread message

Jingcheng Zhang

unread,
Sep 22, 2024, 2:33:34 AMSep 22
to scite-interest
I cannot find a text with '$' in it, the result is invalid. But under windows it works correctly.
Seems the '$' is hijacked by linux shell which makes the problem. How to solve?
Thanks!

Neil Hodgson

unread,
Sep 30, 2024, 2:03:54 AMSep 30
to scite-interest
Jingcheng Zhang:

I cannot find a text with '$' in it, the result is invalid. But under windows it works correctly.
Seems the '$' is hijacked by linux shell which makes the problem. How to solve?

On Linux, the Find in Files command works by running another SciTE process with the text provided as a command-line argument.

The '$' should be quoted with '\' to avoid shell interpretation so '\$'. This can be done in the Slash function.

Another problem is that there is an extra layer of variable interpretation for $(variable) in SciTEBase::Execute that should be avoided for this case.

It would likely be better to reimplement using threads instead of processes as is done for Windows and MacOS.

Neil

Jingcheng Zhang

unread,
Sep 30, 2024, 8:28:16 PMSep 30
to scite-interest
Hi Neil,
I tried to search "\$2800", but the executed command becomes:

SciTE -grep ~~~~ "" "" "\\$2800"

The result is invalid, it adds another "\" character inside. But if I call SciTE in command line directly, it works:

SciTE -grep ~~~~ "" "" "\$2800"

This result is valid. So how can I remove the extra "\" character added by the Find in Files command?

godstech

unread,
Oct 1, 2024, 5:29:07 PMOct 1
to scite-i...@googlegroups.com
Try single quotes to avoid interpolation:

SciTE -grep ~~~~ "" "" '$2800'


- Francisco 

-------- Mensaje original --------
De: Jingcheng Zhang <dio...@gmail.com>
Fecha: 30/9/2024 7:28 p. m. (GMT-06:00)
A: scite-interest <scite-i...@googlegroups.com>
Asunto: [scite] Re: Under Linux, "Find in Files" with a '$' character doesn't work

--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scite-interes...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scite-interest/522a0c2f-3413-45a0-b502-8e4158c61873n%40googlegroups.com.

Neil Hodgson

unread,
Oct 1, 2024, 5:43:21 PMOct 1
to scite-interest
Jingcheng Zhang::

I tried to search "\$2800", but the executed command becomes:

SciTE -grep ~~~~ "" "" "\\$2800"

   The Slash function protects the \ you entered by converting it to \\. This Slash function likely needs to change while not affecting other callers.


Try single quotes to avoid interpolation:

Unfortunately, replacing double quotes with single quotes in the code would make it difficult to search for single quotes.

Neil
Reply all
Reply to author
Forward
Message has been deleted
0 new messages