[Info-vax] Suggestion: Enhance DCL to support proper escape quoting.
Jan-Erik Söderholm
jan-erik.soderholm at telia.com
Thu Jan 20 04:35:14 EST 2022
Den 2022-01-20 kl. 09:28, skrev Phillip Helbig (undress to reply):
> In article <ss9ujo$14m3$1 at gioia.aioe.org>, hb <end.of at inter.net> writes:
>
>> On 1/19/22 9:12 PM, Phillip Helbig (undress to reply) wrote:
>>> In article <ss9lil$764$2 at dont-email.me>, Simon Clubley
>>> <clubley at remove_me.eisner.decus.org-Earth.UFP> writes:
>> ....
>>>> In bash, escaping a special character is simple - you just add a
>>>> backslash in front of the special character, so ' would become \'
>>>> instead. I think that's vastly better and cleaner than how it is
>>>> done in DCL.
>>>
>>> Interestingly, I was searching a .tex file. \<anything> are TeX control
>>> codes. :-|
>>>
>> On VMS:
>> $ ty helloworld.tex
>> \documentclass[12pt]{article}
>> \begin{document}
>> Hello world!
>> $Hello world!$ %math mode
>> \end{document}
>> $ grep "\\end" helloworld.tex
>> \end{document}
>> $
>> Same command works in bash, although one would prefer
>> $ grep '\\end' helloworld.tex
>
> Consider the TeX command \". OK, to search for it I need to escape the
> backslash, thus search for \\". But then " is part of what I'm
> searching for, so using that as a delimiter is also tricky.
If " is escapable, it would be '$ grep "\\\"" helloworld.tex'.
Or if that line is processed by DCL, maybe '$ grep "\\""" helloworld.tex'.
The usual double double-quote to get one double-quote.
> The DCL
> solution has the advantage that it is pretty obvious what it does.
>
> Note that \\ is also a valid TeX command (which means "start a new line
> here". So to search for that I would search for \\\\?
>
Yes, two (2) escaped backslashes looks fine.
>
More information about the Info-vax
mailing list