Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

We want to create puppets that pull their own strings. -- Ann Marion


devel / comp.unix.shell / unterminated

SubjectAuthor
* unterminatedJames Smith
+- Re: unterminatedKeith Thompson
+* Re: unterminatedKenny McCormack
|`* Re: unterminatedChristian Weisgerber
| `* Re: unterminatedBen Bacarisse
|  `* Re: unterminatedChristian Weisgerber
|   `- Re: unterminatedBen Bacarisse
`- Re: unterminatedJanis Papanagnou

1
unterminated

<5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4231&group=comp.unix.shell#4231

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:5845:: with SMTP id h5mr1131742qth.91.1629170037190;
Mon, 16 Aug 2021 20:13:57 -0700 (PDT)
X-Received: by 2002:a05:620a:290e:: with SMTP id m14mr1648635qkp.292.1629170037029;
Mon, 16 Aug 2021 20:13:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Mon, 16 Aug 2021 20:13:56 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=76.75.103.130; posting-account=6O69HwoAAACYsQt3_Zb1qnAQTkTUy-8l
NNTP-Posting-Host: 76.75.103.130
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
Subject: unterminated
From: bjlockie...@gmail.com (James Smith)
Injection-Date: Tue, 17 Aug 2021 03:13:57 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1121
 by: James Smith - Tue, 17 Aug 2021 03:13 UTC

Do you see why this command is unterminated?
$ convert -draw 'text 2,120 "Where: x\'s"'
I'm trying to build a string for a command and run it from python.
I can't run it from the shell. :-(

Re: unterminated

<87r1eshesy.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4232&group=comp.unix.shell#4232

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.unix.shell
Subject: Re: unterminated
Date: Mon, 16 Aug 2021 21:32:13 -0700
Organization: None to speak of
Lines: 23
Message-ID: <87r1eshesy.fsf@nosuchdomain.example.com>
References: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="a738f8325e8976facab6faafffb72267";
logging-data="3643"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BncD52QQwQen+AonVJhQ5"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:ovoot5v2gYAlOhSnPm9a27aSRq0=
sha1:NC4WinfJcvc4wZ3oz3ynQ8eD63w=
 by: Keith Thompson - Tue, 17 Aug 2021 04:32 UTC

James Smith <bjlockie021@gmail.com> writes:
> Do you see why this command is unterminated?
> $ convert -draw 'text 2,120 "Where: x\'s"'
> I'm trying to build a string for a command and run it from python.
> I can't run it from the shell. :-(

Because you can't escape a single-quote character within a single-quoted
string.

$ echo 'foo\'
foo\
$

If you're using bash, consider using its "ANSI-C Quoting" feature.
https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html

(I'd suggest how to do it, but I'm not 100% sure what string you're
trying to print.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

Re: unterminated

<sffm44$tntd$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4233&group=comp.unix.shell#4233

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: unterminated
Date: Tue, 17 Aug 2021 06:48:36 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <sffm44$tntd$1@news.xmission.com>
References: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
Injection-Date: Tue, 17 Aug 2021 06:48:36 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="974765"; 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 - Tue, 17 Aug 2021 06:48 UTC

In article <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>,
James Smith <bjlockie021@gmail.com> wrote:
>Do you see why this command is unterminated?
>$ convert -draw 'text 2,120 "Where: x\'s"'
>I'm trying to build a string for a command and run it from python.
>I can't run it from the shell. :-(

To embed a single quoted inside a single-quoted string in a POSIX-ish
shell, you need to replace each occurrence of ' with the 5 character
sequence: '"'"'
(which looks weird/complicated, until you realize it is just 5 keystrokes
of alternating quotes).

So, your example becomes:

$ convert -draw 'text 2,120 "Where: x'"'"'s"'

I have various aliases and scripts setup to do this replacement when I need
it to be done...

--
Donald Drumpf claims to be "the least racist person you'll ever meet".

This would be true if the only other person you've ever met was David Duke.

Re: unterminated

<sfg3qm$etu$1@news-1.m-online.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4238&group=comp.unix.shell#4238

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!news.karotte.org!news.space.net!news.m-online.net!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: unterminated
Date: Tue, 17 Aug 2021 12:42:29 +0200
Organization: (posted via) M-net Telekommunikations GmbH
Lines: 20
Message-ID: <sfg3qm$etu$1@news-1.m-online.net>
References: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
NNTP-Posting-Host: aftr-62-216-206-212.dynamic.mnet-online.de
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: news-1.m-online.net 1629196950 15294 62.216.206.212 (17 Aug 2021 10:42:30 GMT)
X-Complaints-To: news@news-1.m-online.net
NNTP-Posting-Date: Tue, 17 Aug 2021 10:42:30 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
X-Enigmail-Draft-Status: N1110
In-Reply-To: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
 by: Janis Papanagnou - Tue, 17 Aug 2021 10:42 UTC

On 17.08.2021 05:13, James Smith wrote:
> Do you see why this command is unterminated?
> $ convert -draw 'text 2,120 "Where: x\'s"'
> I'm trying to build a string for a command and run it from python.
> I can't run it from the shell. :-(

Depending on the quotes it's sometimes helpful to use the other quote
type as surrounding brace and escape the inner

convert -draw "text 2,120 \"Where: x's\""

If (since) it's only a string argument to the convert command it may
also be possible to use other typographical quotes (Unicode supports
a lot) in the inner string, so that you don't even need escapes? E.g.

convert -draw "text 2,120 “Where: x's”"

Janis

Re: unterminated

<slrnshn7pi.2eh4.naddy@lorvorc.mips.inka.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4239&group=comp.unix.shell#4239

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: nad...@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.unix.shell
Subject: Re: unterminated
Date: Tue, 17 Aug 2021 11:36:18 -0000 (UTC)
Message-ID: <slrnshn7pi.2eh4.naddy@lorvorc.mips.inka.de>
References: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
<sffm44$tntd$1@news.xmission.com>
Injection-Date: Tue, 17 Aug 2021 11:36:18 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="80421"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Tue, 17 Aug 2021 11:36 UTC

On 2021-08-17, Kenny McCormack <gazelle@shell.xmission.com> wrote:

> To embed a single quoted inside a single-quoted string in a POSIX-ish
> shell, you need to replace each occurrence of ' with the 5 character
> sequence: '"'"'

This one is shorter: '\''

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: unterminated

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

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4240&group=comp.unix.shell#4240

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: unterminated
Date: Tue, 17 Aug 2021 13:35:42 +0100
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <87zgtgtfj5.fsf@bsb.me.uk>
References: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
<sffm44$tntd$1@news.xmission.com>
<slrnshn7pi.2eh4.naddy@lorvorc.mips.inka.de>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="a7cea22e639917a9faf9270d06f26763";
logging-data="12988"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1841cc64Rc86Vk6FbYAuHgZcE5O+0foeqU="
Cancel-Lock: sha1:ABwdQDDTkPESRmTUsXIGGVQj0c4=
sha1:svGHAgKqiHfQGgZe+JpImWajTcw=
X-BSB-Auth: 1.459b7ca7265e54154112.20210817133542BST.87zgtgtfj5.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 17 Aug 2021 12:35 UTC

Christian Weisgerber <naddy@mips.inka.de> writes:

> On 2021-08-17, Kenny McCormack <gazelle@shell.xmission.com> wrote:
>
>> To embed a single quoted inside a single-quoted string in a POSIX-ish
>> shell, you need to replace each occurrence of ' with the 5 character
>> sequence: '"'"'
>
> This one is shorter: '\''

.... but does not work in a POSIX-ish shell like bash. Does it work in
any shell?

--
Ben.

Re: unterminated

<slrnshnipf.2pv2.naddy@lorvorc.mips.inka.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4241&group=comp.unix.shell#4241

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: nad...@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.unix.shell
Subject: Re: unterminated
Date: Tue, 17 Aug 2021 14:43:59 -0000 (UTC)
Message-ID: <slrnshnipf.2pv2.naddy@lorvorc.mips.inka.de>
References: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
<sffm44$tntd$1@news.xmission.com>
<slrnshn7pi.2eh4.naddy@lorvorc.mips.inka.de> <87zgtgtfj5.fsf@bsb.me.uk>
Injection-Date: Tue, 17 Aug 2021 14:43:59 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="92131"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Tue, 17 Aug 2021 14:43 UTC

On 2021-08-17, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

>>> To embed a single quoted inside a single-quoted string in a POSIX-ish
>>> shell, you need to replace each occurrence of ' with the 5 character
>>> sequence: '"'"'
>>
>> This one is shorter: '\''
>
> ... but does not work in a POSIX-ish shell like bash.

Of course it does.

Say you want to print "fool's gold".

Start with a single-quoted string without the apostrophe:
$ echo 'fools gold'

Now split it in two single-quoted strings without intervening space:
$ echo 'fool''s gold'

Then add a quoted single quote, i.e., \' between the two parts:
$ echo 'fool'\''s gold'

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: unterminated

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

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4242&group=comp.unix.shell#4242

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: unterminated
Date: Tue, 17 Aug 2021 17:05:11 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <87czqct5u0.fsf@bsb.me.uk>
References: <5bcdfe16-d168-485d-8779-b780c47db963n@googlegroups.com>
<sffm44$tntd$1@news.xmission.com>
<slrnshn7pi.2eh4.naddy@lorvorc.mips.inka.de>
<87zgtgtfj5.fsf@bsb.me.uk>
<slrnshnipf.2pv2.naddy@lorvorc.mips.inka.de>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="a7cea22e639917a9faf9270d06f26763";
logging-data="13379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19x9NhSAY4xSiEvKt9c0iS93sr9UUqVQqc="
Cancel-Lock: sha1:7LdcPwqY9QvguOuYPrwjTo7e7jM=
sha1:DlLAPjwoUQSch0KGctn+6MSNnkU=
X-BSB-Auth: 1.0b5c8ecb1f89ddcd3611.20210817170511BST.87czqct5u0.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 17 Aug 2021 16:05 UTC

Christian Weisgerber <naddy@mips.inka.de> writes:

> On 2021-08-17, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>
>>>> To embed a single quoted inside a single-quoted string in a POSIX-ish
>>>> shell, you need to replace each occurrence of ' with the 5 character
>>>> sequence: '"'"'
>>>
>>> This one is shorter: '\''
>>
>> ... but does not work in a POSIX-ish shell like bash.
>
> Of course it does.

I see what you are suggesting. I thought you were suggesting simply
putting the \ in the quotes. It seems obvious now that you were clearly
suggesting replacing the whole five char sequence '"'"' with four '\''.

My apologies.

--
Ben.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor