[Info-vax] SEARCH ''

George Cornelius cornelius at eisner.decus.org
Tue Jan 25 09:20:43 EST 2022


George Cornelius <cornelius at eisner.decus.org> wrote:
> David Jones <osuvman50 at gmail.com> wrote:
>> On Monday, January 17, 2022 at 3:52:13 PM UTC-5, Phillip Helbig (undress to reply) wrote:
>>> I had occasion to SEARCH for the string '' in a file. 
>>> 
>>> Is there any way to do this? (It gets expanded as an empty symbol; I 
>>> don't know how to prevent that.) 
>>> 
>> 
>> $ dsq = "'" + "'"   ! make symbol containing 2 single quotes
>> $ search myfile.txt &dsq
> 
> What's wrong with the old familiar way?
> 
>   $ search myfile.txt "''dsq'"   ?
> 
> This has benefits as well when searching for more complex sequences: 
> 
>   $ pip tick="'" ; search myfile.txt "''tick'''tick'MYSYMBOL''tick'"
> 
> I don't use &symbol often because I'm not sure I understand
> precisely how it differs from the ''symbol' embedded in DQ's.

To answer my own question (since my second example does not work
at all, but does seem to be ok with '' in place of '''):

The embedded ''symbol' form has its own complications.

George


More information about the Info-vax mailing list