Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

PLUG IT IN!!!


devel / comp.unix.shell / (bash) Which characters are magic inside of double quotes?

SubjectAuthor
* (bash) Which characters are magic inside of double quotes?Kenny McCormack
`* (bash) Which characters are magic inside of double quotes?Lew Pitcher
 `* (bash) Which characters are magic inside of double quotes?Kenny McCormack
  `* (bash) Which characters are magic inside of double quotes?Helmut Waitzmann
   +- (bash) Which characters are magic inside of double quotes?Kenny McCormack
   `* (bash) Which characters are magic inside of double quotes?Ben Bacarisse
    `* (bash) Which characters are magic inside of double quotes?Helmut Waitzmann
     `- (bash) Which characters are magic inside of double quotes?Janis Papanagnou

1
(bash) Which characters are magic inside of double quotes?

<ujt0m3$3urip$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7545&group=comp.unix.shell#7545

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: (bash) Which characters are magic inside of double quotes?
Date: Sat, 25 Nov 2023 14:34:43 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ujt0m3$3urip$1@news.xmission.com>
Injection-Date: Sat, 25 Nov 2023 14:34:43 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="4157017"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sat, 25 Nov 2023 14:34 UTC

I can think of only two: $ and `

Am I forgetting anything?

--
The book "1984" used to be a cautionary tale;
Now it is a "how-to" manual.

Re: (bash) Which characters are magic inside of double quotes?

<ujt24f$2qv42$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7546&group=comp.unix.shell#7546

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: lew.pitcher@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: (bash) Which characters are magic inside of double quotes?
Date: Sat, 25 Nov 2023 14:59:27 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <ujt24f$2qv42$1@dont-email.me>
References: <ujt0m3$3urip$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 25 Nov 2023 14:59:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c75300d95f7954f3c5b351e703ebdf85";
logging-data="2980994"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jzD2fQavr9cXaERdggaySai37uIR4El8="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:Wk31Nirs+H0VlMRYmzbYo4uCf8c=
 by: Lew Pitcher - Sat, 25 Nov 2023 14:59 UTC

On Sat, 25 Nov 2023 14:34:43 +0000, Kenny McCormack wrote:

> I can think of only two: $ and `
>
> Am I forgetting anything?

From the bash(1) manpage:

"Enclosing characters in double quotes preserves the literal value of
all characters within the quotes, with the exception of $, `, \, and,
when history expansion is enabled, !."

So the list is:
$
`
\
!

--
Lew Pitcher
"In Skills We Trust"

Re: (bash) Which characters are magic inside of double quotes?

<ujt7q0$3uvds$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7547&group=comp.unix.shell#7547

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: (bash) Which characters are magic inside of double quotes?
Date: Sat, 25 Nov 2023 16:36:16 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ujt7q0$3uvds$1@news.xmission.com>
References: <ujt0m3$3urip$1@news.xmission.com> <ujt24f$2qv42$1@dont-email.me>
Injection-Date: Sat, 25 Nov 2023 16:36:16 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="4160956"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sat, 25 Nov 2023 16:36 UTC

In article <ujt24f$2qv42$1@dont-email.me>,
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>On Sat, 25 Nov 2023 14:34:43 +0000, Kenny McCormack wrote:
>
>> I can think of only two: $ and `
>>
>> Am I forgetting anything?
>
>
>From the bash(1) manpage:
>
> "Enclosing characters in double quotes preserves the literal value of
> all characters within the quotes, with the exception of $, `, \, and,
> when history expansion is enabled, !."
>
>So the list is:
> $
> `
> \
> !

Thanks. Luckily, I don't have to worry about !. But I think \ is a dark
corner. It sometimes needs to be escaped; sometime not. It is weird. We
had a discussion (started by me) a while back about this and the conclusion
was as stated (that it is sort of a dark corner).

The overall context of this question is embedding scripts (for various
interpreted languages) inside shell scripts. For most languages, such as
"AWK", you just put it all inside single quotes and everything is fine,
Most languages use double quotes internally for string delimiting, and it
all just works. And if you need a single quote, you can usually write \047.

But there are two languages where the string delimiter is single quote
(usually) and for those languages, it ends up being more convenient to
enclose the script (in the shell script) with double quotes. But then you
have to worry about the fact that double quotes are not "strong" quotes.
Hence, this thread.

The two languages I am referring to are "VIM" and "SQL". Both of these
languages are defined in terms of using single quotes as the string
delimiter, but both sortof/kindof/maybe also accept double quotes. So, you
can sometimes get away with using double quotes, but sometimes not.

--
The people who were, are, and always will be, wrong about everything, are still
calling *us* "libtards"...

(John Fugelsang)

Re: (bash) Which characters are magic inside of double quotes?

<83bkbhcho1.fsf@helmutwaitzmann.news.arcor.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7548&group=comp.unix.shell#7548

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nn.throttle@xoxy.net (Helmut Waitzmann)
Newsgroups: comp.unix.shell
Subject: Re: (bash) Which characters are magic inside of double quotes?
Date: Sun, 26 Nov 2023 04:33:34 +0100
Organization: A noiseless patient Spider
Lines: 61
Sender: Helmut Waitzmann <12f7e638@mail.de>
Message-ID: <83bkbhcho1.fsf@helmutwaitzmann.news.arcor.de>
References: <ujt0m3$3urip$1@news.xmission.com> <ujt24f$2qv42$1@dont-email.me>
<ujt7q0$3uvds$1@news.xmission.com>
Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="e54860a40bfa8d12a9b2c55d8dd35fb8";
logging-data="3333289"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19j5VOAGI+7vFp7c5QLYdS/9Isc0W5JHuI="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:IrlYf+YNCbyIog8UzDg1oa8iRxk=
sha1:yS8e36EPsgJ3jua5zd8wEbVZjMY=
Mail-Copies-To: nobody
Mail-Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>
 by: Helmut Waitzmann - Sun, 26 Nov 2023 03:33 UTC

gazelle@shell.xmission.com (Kenny McCormack):

[The question: Which characters are magic inside of double
quotes?]

> The overall context of this question is embedding scripts (for
> various interpreted languages) inside shell scripts. For most
> languages, such as "AWK", you just put it all inside single
> quotes and everything is fine, Most languages use double quotes
> internally for string delimiting, and it all just works. And if
> you need a single quote, you can usually write \047.
>
>
> But there are two languages where the string delimiter is single
> quote (usually) and for those languages, it ends up being more
> convenient to enclose the script (in the shell script) with
> double quotes. But then you have to worry about the fact that
> double quotes are not "strong" quotes. Hence, this thread.
>
>
> The two languages I am referring to are "VIM" and "SQL". Both of
> these languages are defined in terms of using single quotes as
> the string delimiter, but both sortof/kindof/maybe also accept
> double quotes. So, you can sometimes get away with using double
> quotes, but sometimes not.
>
>

But you can always do it like this:

For every script to be embedded inside a shell script, procede
using the following rules:

In the script to be embedded, replace each single quote by a
single quote, a backslash, and 2 single quotes (or insert before
each single quote a single quote, a backslash, and a single quote
or insert after each single quote a backslash and 2 single
quotes).

After this has been done, prepend the whole script to be embedded
with a single quote and append a single quote.

Embed the result.

That's it.  It will work with any script to be embedded into a
shell script regardless the language of the script to be
embedded.

The advantage of this procedure:  It can be done using a
search‐and‐replace command in your favorite text editor, as well
as by a "sed" or "awk" command invocation or even by a shell
script.

Re: (bash) Which characters are magic inside of double quotes?

<ujus5t$3vrcf$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7549&group=comp.unix.shell#7549

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!newsfeed.endofthelinebbs.com!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: (bash) Which characters are magic inside of double quotes?
Date: Sun, 26 Nov 2023 07:30:06 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ujus5t$3vrcf$1@news.xmission.com>
References: <ujt0m3$3urip$1@news.xmission.com> <ujt24f$2qv42$1@dont-email.me> <ujt7q0$3uvds$1@news.xmission.com> <83bkbhcho1.fsf@helmutwaitzmann.news.arcor.de>
Injection-Date: Sun, 26 Nov 2023 07:30:06 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="4189583"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sun, 26 Nov 2023 07:30 UTC

In article <83bkbhcho1.fsf@helmutwaitzmann.news.arcor.de>,
Helmut Waitzmann <oe.throttle@xoxy.net> wrote:
....
> For every script to be embedded inside a shell script, procede
> using the following rules:
>
>
> In the script to be embedded, replace each single quote by a
> single quote, a backslash, and 2 single quotes (or insert before
> each single quote a single quote, a backslash, and a single quote
> or insert after each single quote a backslash and 2 single
> quotes).

Yes, this works. But it is ugly. In the past, I've used the trick of
replacing ' with '"'"' - but as you say, replacing it with '\'' saves one
character.

But it is just unaesthetically pleasing. In the instant case, I found it
easier to go with " instead of ' and to "hope for the best". It all worked
out fine, as the embedded script didn't have any of the "magic" characters
in it.

The process described above, of replacing the ' with a 4 or 5 character
replacement string, is not too bad for AWK, where ' is rare, but gets ugly
with either of the mentioned languages (VIM and SQL), where the ' is
common.

--
The whole aim of practical politics is to keep the populace alarmed (and hence clamorous
to be led to safety) by menacing it with an endless series of hobgoblins, all of them imaginary.

H. L. Mencken

Re: (bash) Which characters are magic inside of double quotes?

<87a5r06w8m.fsf@bsb.me.uk>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7550&group=comp.unix.shell#7550

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: (bash) Which characters are magic inside of double quotes?
Date: Sun, 26 Nov 2023 21:27:37 +0000
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <87a5r06w8m.fsf@bsb.me.uk>
References: <ujt0m3$3urip$1@news.xmission.com> <ujt24f$2qv42$1@dont-email.me>
<ujt7q0$3uvds$1@news.xmission.com>
<83bkbhcho1.fsf@helmutwaitzmann.news.arcor.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="5c1a21d27bc52d17d9148af67c285c83";
logging-data="3597409"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MrKmluQUSOnflB5u+m27/3x/ZbX0UsNI="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:xQzZywqd6CIW9pJgWkNtQM6cs3U=
sha1:bjtA3GtcbOd3Afm6rnbi7SWuANs=
X-BSB-Auth: 1.cc9372a0fbddd00ecdab.20231126212737GMT.87a5r06w8m.fsf@bsb.me.uk
 by: Ben Bacarisse - Sun, 26 Nov 2023 21:27 UTC

Helmut Waitzmann <nn.throttle@xoxy.net> writes:

> gazelle@shell.xmission.com (Kenny McCormack):
>
> [The question: Which characters are magic inside of double quotes?]

>> The overall context of this question is embedding scripts (for
>> various interpreted languages) inside shell scripts. For most >
>> languages, such as "AWK", you just put it all inside single > quotes
>> and everything is fine, Most languages use double quotes > internally
>> for string delimiting, and it all just works. And if > you need a
>> single quote, you can usually write \047.
>>
>> But there are two languages where the string delimiter is single quote
>> (usually) and for those languages, it ends up being more convenient to
>> enclose the script (in the shell script) with double quotes. But then you
>> have to worry about the fact that double quotes are not "strong"
>> quotes. Hence, this thread. The two languages I am referring to are "VIM"
>> and "SQL". Both of these languages are defined in terms of using single
>> quotes as the string delimiter, but both sortof/kindof/maybe also accept
>> double quotes. So, you can sometimes get away with using double quotes,
>> but sometimes not.
>
> But you can always do it like this: For every script to be embedded inside
> a shell script, procede using the following rules: In the script to be
> embedded, replace each single quote by a single quote, a backslash, and 2
> single quotes [alternatives elided...]

That works well when there is a "build process" for the script that
contains the embedded script because, as you say, it's easy to automate.
But I find it fragile when the embedded script might be edited and hard
to read when the script needs to be inspected. Lots of '\''...'\''s get
in the way.

My preference is for here documents. You can choose a clear and
staggeringly unlikely delimiter, and the text between the start and the
end is taken literally (if you 'quote-the-end-delimiter').

This works best for standard input, but when I need a single string
argument I put "$(cat in front and )" at the end. Not pretty, perhaps,
but it keeps all of the mess away from the actual embedded script:

printf "{%s}\n" "$(cat <<'---END-OF-EMBEDDED-SCRIPT---'
....script here...
---END-OF-EMBEDDED-SCRIPT---
)"

--
Ben.

Re: (bash) Which characters are magic inside of double quotes?

<831qbtklvk.fsf@helmutwaitzmann.news.arcor.de>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7576&group=comp.unix.shell#7576

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nn.throttle@xoxy.net (Helmut Waitzmann)
Newsgroups: comp.unix.shell
Subject: Re: (bash) Which characters are magic inside of double quotes?
Date: Mon, 11 Dec 2023 12:40:47 +0100
Organization: A noiseless patient Spider
Lines: 82
Sender: Helmut Waitzmann <12f7e638@mail.de>
Message-ID: <831qbtklvk.fsf@helmutwaitzmann.news.arcor.de>
References: <ujt0m3$3urip$1@news.xmission.com> <ujt24f$2qv42$1@dont-email.me>
<ujt7q0$3uvds$1@news.xmission.com>
<83bkbhcho1.fsf@helmutwaitzmann.news.arcor.de>
<87a5r06w8m.fsf@bsb.me.uk>
Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="4f341f14b04e0315cb67e42a6a2afa80";
logging-data="3314045"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18mkPPCzuQb5RZY8HmNAFDqHOQO+Az7KHQ="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:3CC1yy4BBTIohRPKt+P35s8Q2Kk=
sha1:DwgDNOsItmNoX+N14bQalr4B3iU=
Mail-Copies-To: nobody
Mail-Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>
 by: Helmut Waitzmann - Mon, 11 Dec 2023 11:40 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk>:
> Helmut Waitzmann <nn.throttle@xoxy.net> writes:
>
>> But you can always do it like this:  For every script to be
>> embedded inside a shell script, procede using the following
>> rules:  In the script to be embedded, replace each single quote
>> by a single quote, a backslash, and 2 single quotes
>> [alternatives elided...]
>
> That works well when there is a "build process" for the script that
> contains the embedded script because, as you say, it's easy to automate.
> But I find it fragile when the embedded script might be edited and hard
> to read when the script needs to be inspected. Lots of '\''...'\''s get
> in the way.

Yes, that's true.  In this case, I either include the script to
be embedded in its original form, each line of it preceded by

#

in the shell script as well, that is, save it as a shell comment
for a later source of re-editing.

Or, when the embedded script is to be to re-edited, construct a
shell command to be run:  Start that command with the shell
command line fragment

printf '%s' \

then copy and paste the embedded script, which is to be
re-edited, into the following lines, either in a shell script
file or use the features of your favourite editor to run a shell
command line.  Then run that shell script file (resp. the shell
command line).

The standard output will be the original script to be embedded.

> My preference is for here documents. You can choose a clear and
> staggeringly unlikely delimiter, and the text between the start and the
> end is taken literally (if you 'quote-the-end-delimiter').
>
> This works best for standard input, but when I need a single string
> argument I put "$(cat in front and )" at the end. Not pretty, perhaps,
> but it keeps all of the mess away from the actual embedded script:
>
> printf "{%s}\n" "$(cat <<'---END-OF-EMBEDDED-SCRIPT---'
> ...script here...
> ---END-OF-EMBEDDED-SCRIPT---
> )"

When using here documents, I tend to use

cut -d . -f2- <<-EOF
.These are the lines of the script to be embedded,
.each of them prepended with the "cut" delimiter.
.Even indented lines like the following
. indented line
.will have their indentation preserved.
EOF

rather than just "cat", prepending each line of the script to be
embedded with a non-whitespace delimiter (for example a period): 
That allows me to neatly indent the here document using TAB
characters according to the indentation level of its context in
the shell script and also frees me from having to worry about
looking for a suitable here document delimiter: "EOF" (for
example) will always work, as it is different from any line
starting with zero or more white space characters followed by a
period.

Re: (bash) Which characters are magic inside of double quotes?

<ul77fs$36rl1$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7577&group=comp.unix.shell#7577

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: (bash) Which characters are magic inside of double quotes?
Date: Mon, 11 Dec 2023 15:48:27 +0100
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <ul77fs$36rl1$1@dont-email.me>
References: <ujt0m3$3urip$1@news.xmission.com> <ujt24f$2qv42$1@dont-email.me>
<ujt7q0$3uvds$1@news.xmission.com>
<83bkbhcho1.fsf@helmutwaitzmann.news.arcor.de> <87a5r06w8m.fsf@bsb.me.uk>
<831qbtklvk.fsf@helmutwaitzmann.news.arcor.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Dec 2023 14:48:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2308ee0b07fdff57ae97ce94e431de07";
logging-data="3370657"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+06rX1iTYeH0SIOtk1pgDg"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:9Sdz4vKFTrytfj2RWW0Ek3fNijI=
In-Reply-To: <831qbtklvk.fsf@helmutwaitzmann.news.arcor.de>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Mon, 11 Dec 2023 14:48 UTC

On 11.12.2023 12:40, Helmut Waitzmann wrote:
>
> When using here documents, I tend to use
>
> cut -d . -f2- <<-EOF
> .These are the lines of the script to be embedded,
> .each of them prepended with the "cut" delimiter.
> .Even indented lines like the following
> . indented line
> .will have their indentation preserved.
> EOF
>
>
> rather than just "cat", prepending each line of the script to be
> embedded with a non-whitespace delimiter (for example a period): That
> allows me to neatly indent the here document using TAB characters
> according to the indentation level of its context in the shell script
> and also frees me from having to worry about looking for a suitable here
> document delimiter: "EOF" (for example) will always work, as it is
> different from any line starting with zero or more white space
> characters followed by a period.

Ksh users may use '<<#' as in

cat <<# EOF
These are the lines of the script to be embedded.
Even indented lines like the following
tab-indented line
space-indented line
will have their indentation preserved.
EOF

"If # is appended to <<, then leading spaces and tabs will
be stripped off the first line of the document and up to an
equivalent indentation will be stripped from the remaining
lines and from word." [man ksh]

(Note: by "word" the 'EOF' is meant here. It can also be
indented if desired.)

Janis

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor