Subject: Re: [PATCH v2 1/2] etc/guix-install.sh: Initialize XDG base directories.

From: Ludovic Courtès <[email-masked]>
Date: Mon, 04 Jul 2022 23:01:34 +0200

"Philip McGrath" <[email-masked]> skribis:

> AFAICT, this seems to work. I think this is because of a rule I didn't know about before from the section "Here Documents" under `info "(bash)Redirections"`:
>
>> If any part of *word* is quoted, the *delimiter* is the result of
>> quote removal on *word*, and the lines in the here-document
>> are not expanded.
>
> and the beginning EOF is quoted, so it works like this:
>
> $ cat quoted-here-doc.sh 
> #!/bin/sh
> cat <<"EOF" > out.sh
> export PATH="$PATH:foobar"
> EOF
> $ ./quoted-here-doc.sh 
> $ cat out.sh 
> export PATH="$PATH:foobar"
>
> I'm certainly no expert on shell quoting, though.

Woow, I learned something, thanks!  Crazy.  (I wonder what Dash does
with that, given that it doesn’t support multi-digit file descriptor
numbers for redirects…)

Ludo’.