Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"There... I've run rings 'round you logically" -- Monty Python's Flying Circus


devel / comp.unix.shell / Re: The angle bracket in an echo command???

SubjectAuthor
* The angle bracket in an echo command???Kenny McCormack
`* The angle bracket in an echo command???Ivan Shmakov
 +* !: a bad idea (Was: The angle bracket in an echo command???)Kenny McCormack
 |`* !: a bad idea (Was: The angle bracket in an echo command???)Kaz Kylheku
 | `- !: a bad ideaAxel Reichert
 `* The angle bracket in an echo command???Ben Bacarisse
  `* The angle bracket in an echo command???Spiros Bousbouras
   +* The angle bracket in an echo command???Ben Bacarisse
   |`* The angle bracket in an echo command???Axel Reichert
   | +- The angle bracket in an echo command???Janis Papanagnou
   | `* The angle bracket in an echo command???Benjamin Esham
   |  `- The angle bracket in an echo command???Ben Bacarisse
   `- The angle bracket in an echo command???Spiros Bousbouras

1
Re: The angle bracket in an echo command???

<u6d477$vron$1@news.xmission.com>

  copy mid

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

  copy link   Newsgroups: alt.msdos.batch 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: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: alt.msdos.batch,comp.unix.shell
Subject: Re: The angle bracket in an echo command???
Date: Wed, 14 Jun 2023 19:25:27 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u6d477$vron$1@news.xmission.com>
References: <34694C8D.110316AD@bikerider.com> <e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com> <20230513093439.9efb791c12665517e1dd466c@127.0.0.1> <51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
Injection-Date: Wed, 14 Jun 2023 19:25:27 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1044247"; 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 - Wed, 14 Jun 2023 19:25 UTC

In article <51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>,
Muhammad Usman <muhammadusman319320@gmail.com> wrote:
>On Saturday, 13 May 2023 at 13:36:03 UTC+5, Kerr-Mudd, John wrote:
>> On Fri, 12 May 2023 23:53:16 -0700 (PDT)
>> Muhammad Usman <muhammadu...@gmail.com> wrote:
>>
>> > I got the solution just after 26 years. Use single quotes such as
>> ... and changing OS.
>> > echo -e '<!DOCTYPE html>'
>> > will solve the issue.
>> >
>> > If we use double quotes, it will surely raise an error.
>> > echo -e "<!DOCTYPE html>"
>> > ```bash: !DOCTYPE: event not found```
....

>I was doing it on bash shell linux. Never tried it on DOS or windows

Then you posted to the wrong newsgroup.

Anyway, believe it or not, it is not the angle brackets that are giving you
grief (see below - *); rather, it is the exclamation point (!). You need to
read up on the topic of "history substitution" in "man bash".

(*) Basically, either single or double quotes will protect angle brackets,
but you need single quotes to protect "!".

--
Faith doesn't give you the answers; it just stops you from asking the questions.

Re: The angle bracket in an echo command???

<u6fvb9$hdk2$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell alt.msdos.batch
Followup: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ivan@siamics.netNOSPAM.invalid (Ivan Shmakov)
Newsgroups: comp.unix.shell,alt.msdos.batch
Subject: Re: The angle bracket in an echo command???
Followup-To: comp.unix.shell
Date: Thu, 15 Jun 2023 21:20:42 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <u6fvb9$hdk2$1@dont-email.me>
References: <34694C8D.110316AD@bikerider.com>
<e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com>
<20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com>
Injection-Date: Thu, 15 Jun 2023 21:20:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6678708100559b740e5279b06380b171";
logging-data="571010"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mCIK7CszUxqHIyix2vwFK"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:83VhfUWhifOBpHbFjFc5LT5w9JE=
License: CC0-1.0 (original contributions only)
 by: Ivan Shmakov - Thu, 15 Jun 2023 21:20 UTC

>>>>> On 2023-06-14, Kenny McCormack wrote:
>>>>> MU == Muhammad Usman <muhammadu...@gmail.com> wrote:

MU> I got the solution just after 26 years. Use single quotes such as
MU> echo -e '<!DOCTYPE html>'
MU> will solve the issue.

[...]

> Anyway, believe it or not, it is not the angle brackets that are
> giving you grief (see below - *); rather, it is the exclamation point
> (!). You need to read up on the topic of "history substitution" in
> "man bash".
> (*) Basically, either single or double quotes will protect angle
> brackets, but you need single quotes to protect "!".

It's also possible to disable history substitution altogether
with 'set +H'.

I believe this behavior is rather confusing to new users, and
given that C-r (reverse-search-history) and cursor keys already
offer a comparable feature, and one likely to fit better with
user's prior experience at that, my suggestion would be to
have it disabled by default.

--
FSF associate member #7257 http://am-1.org/~ivan/

!: a bad idea (Was: The angle bracket in an echo command???)

<u6g0e8$11bqs$1@news.xmission.com>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell alt.msdos.batch
Path: i2pn2.org!i2pn.org!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,alt.msdos.batch
Subject: !: a bad idea (Was: The angle bracket in an echo command???)
Date: Thu, 15 Jun 2023 21:39:20 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <u6g0e8$11bqs$1@news.xmission.com>
References: <34694C8D.110316AD@bikerider.com> <51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com> <u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
Injection-Date: Thu, 15 Jun 2023 21:39:20 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1093468"; 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 - Thu, 15 Jun 2023 21:39 UTC

In article <u6fvb9$hdk2$1@dont-email.me>,
Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> wrote:
....
> It's also possible to disable history substitution altogether
> with 'set +H'.
>
> I believe this behavior is rather confusing to new users, and
> given that C-r (reverse-search-history) and cursor keys already
> offer a comparable feature, and one likely to fit better with
> user's prior experience at that, my suggestion would be to
> have it disabled by default.

I agree. The ! thing was brought over into bash from (t)csh and it is
pretty universally a bad idea. In fact, the rules for how it is handled
are even more confusing in bash than they are in (t)csh. I can never tell
from looking at it whether or not it is going to try to trigger a history
expansion or not.

I may do as you suggest and disable it globally in my bash shells.

--
People sleep peaceably in their beds at night only because rough
men stand ready to do violence on their behalf.

George Orwell

Re: The angle bracket in an echo command???

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

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!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: The angle bracket in an echo command???
Date: Thu, 15 Jun 2023 23:40:31 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <87mt10pcww.fsf@bsb.me.uk>
References: <34694C8D.110316AD@bikerider.com>
<e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com>
<20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1bcde1cc5cd745a23baabd07c29b6d77";
logging-data="587470"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+afTLl4WgLHY25Y3Ss5YipmgI/wpL/Aas="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:1HwWLNOeO213ONkkk3Xq7bV96j8=
sha1:NdRpy1Q+8iPYpTNFzYcq/wsfwwk=
X-BSB-Auth: 1.1526aa4fe26fc2e9ce89.20230615234031BST.87mt10pcww.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 15 Jun 2023 22:40 UTC

Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> writes:

>>>>>> On 2023-06-14, Kenny McCormack wrote:
>>>>>> MU == Muhammad Usman <muhammadu...@gmail.com> wrote:
>
> MU> I got the solution just after 26 years. Use single quotes such as
> MU> echo -e '<!DOCTYPE html>'
> MU> will solve the issue.
>
> [...]
>
> > Anyway, believe it or not, it is not the angle brackets that are
> > giving you grief (see below - *); rather, it is the exclamation point
> > (!). You need to read up on the topic of "history substitution" in
> > "man bash".
>
> > (*) Basically, either single or double quotes will protect angle
> > brackets, but you need single quotes to protect "!".
>
> It's also possible to disable history substitution altogether
> with 'set +H'.
>
> I believe this behavior is rather confusing to new users, and
> given that C-r (reverse-search-history) and cursor keys already
> offer a comparable feature, and one likely to fit better with
> user's prior experience at that, my suggestion would be to
> have it disabled by default.

That's been my preference for some time. It was useful decades ago (in
csh if I recall correctly) but I never want it anymore.

--
Ben.

Re: !: a bad idea (Was: The angle bracket in an echo command???)

<20230615170332.471@kylheku.com>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell alt.msdos.batch
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell,alt.msdos.batch
Subject: Re: !: a bad idea (Was: The angle bracket in an echo command???)
Date: Fri, 16 Jun 2023 00:07:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <20230615170332.471@kylheku.com>
References: <34694C8D.110316AD@bikerider.com>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<u6g0e8$11bqs$1@news.xmission.com>
Injection-Date: Fri, 16 Jun 2023 00:07:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9b6a5bedcb8991e78bf7042e2215e7bd";
logging-data="614935"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IZ5mlJjGthLVt/riHo+GuQg1uGSmhjvU="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:oMBcnmL8M4/JcfnYcWXAKFtT7BM=
 by: Kaz Kylheku - Fri, 16 Jun 2023 00:07 UTC

On 2023-06-15, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> In article <u6fvb9$hdk2$1@dont-email.me>,
> Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> wrote:
> ...
>> It's also possible to disable history substitution altogether
>> with 'set +H'.
>>
>> I believe this behavior is rather confusing to new users, and
>> given that C-r (reverse-search-history) and cursor keys already
>> offer a comparable feature, and one likely to fit better with
>> user's prior experience at that, my suggestion would be to
>> have it disabled by default.
>
> I agree. The ! thing was brought over into bash from (t)csh and it is
> pretty universally a bad idea.

Do you remember There was a period in the 1990's when tcsh was widely
used? It was popular among early Linux users, too. I remember
getting a default login shell as tcsh on some systems, having
to change it with chsh.

It hink this was a spill-over effect of csh use on proprietary Unix
systems; people coming from that finding an equivalent in tcsh.

Bash aping some tcsh features (even not so good ones) probably helped
wean people off that.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: !: a bad idea

<87sfasj81l.fsf@axel-reichert.de>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mail@axel-reichert.de (Axel Reichert)
Newsgroups: comp.unix.shell
Subject: Re: !: a bad idea
Date: Fri, 16 Jun 2023 07:22:14 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <87sfasj81l.fsf@axel-reichert.de>
References: <34694C8D.110316AD@bikerider.com>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<u6g0e8$11bqs$1@news.xmission.com> <20230615170332.471@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="48da14afc668a656cd9a12528db14466";
logging-data="795238"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199GjAddR6v0Oc/CjlMF8mMdrcknuofpyY="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:Sjn3TQNwsHVhAIxnbzFD3+Cbu8Q=
sha1:p34D0PbVFQIG6oRyzYbJ7O2C6pI=
 by: Axel Reichert - Fri, 16 Jun 2023 05:22 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:

> Do you remember There was a period in the 1990's when tcsh was widely
> used? It was popular among early Linux users, too. I remember
> getting a default login shell as tcsh on some systems

Yes. At that time I was not familiar with the existence of two different
shell languange families and got quickly used to !$, !*, and !0, which have
entered my command line repertoire permanently.

Best regards

Axel

Re: The angle bracket in an echo command???

<2ZOMvYVxe0ck+Wtiz@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!paganini.bofh.team!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.unix.shell
Subject: Re: The angle bracket in an echo command???
Date: Fri, 16 Jun 2023 11:07:53 -0000 (UTC)
Organization: To protect and to server
Message-ID: <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
References: <34694C8D.110316AD@bikerider.com> <e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com> <20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com> <u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<87mt10pcww.fsf@bsb.me.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 16 Jun 2023 11:07:53 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="2583793"; posting-host="9H7U5kayiTdk7VIdYU44Rw.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
Cancel-Lock: sha256:bWpAZZ+4azGx5Avi8jqidvwDuTnuNEafqRttMnk3c9A=
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
X-Notice: Filtered by postfilter v. 0.9.3
 by: Spiros Bousbouras - Fri, 16 Jun 2023 11:07 UTC

On Thu, 15 Jun 2023 23:40:31 +0100
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
> Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> writes:
> > > (*) Basically, either single or double quotes will protect angle
> > > brackets, but you need single quotes to protect "!".
> >
> > It's also possible to disable history substitution altogether
> > with 'set +H'.
[...]
> That's been my preference for some time. It was useful decades ago (in
> csh if I recall correctly) but I never want it anymore.

I use history substitution all the time. Most often I use !:$ or !:$:h or
!:$:t with the $ occasionally replaced by a command number. I've never had
to consciously remember any rules regarding how the ! is expanded.

Re: The angle bracket in an echo command???

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

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!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: The angle bracket in an echo command???
Date: Fri, 16 Jun 2023 15:26:43 +0100
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <87cz1vo53w.fsf@bsb.me.uk>
References: <34694C8D.110316AD@bikerider.com>
<e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com>
<20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<87mt10pcww.fsf@bsb.me.uk> <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1bcde1cc5cd745a23baabd07c29b6d77";
logging-data="905806"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182c/TegAI3kaCAtlt9hQABEL5PFXjnKys="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:O7CwZxuoBOJvAyrymyuDlWWyHMk=
sha1:IA6d1fam2kfyetBUqUWpS2QX27k=
X-BSB-Auth: 1.e396362752db06dcb063.20230616152643BST.87cz1vo53w.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 16 Jun 2023 14:26 UTC

Spiros Bousbouras <spibou@gmail.com> writes:

> On Thu, 15 Jun 2023 23:40:31 +0100
> Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>> Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> writes:
>> > > (*) Basically, either single or double quotes will protect angle
>> > > brackets, but you need single quotes to protect "!".
>> >
>> > It's also possible to disable history substitution altogether
>> > with 'set +H'.
> [...]
>> That's been my preference for some time. It was useful decades ago (in
>> csh if I recall correctly) but I never want it anymore.
>
> I use history substitution all the time. Most often I use !:$ or !:$:h or
> !:$:t with the $ occasionally replaced by a command number. I've never had
> to consciously remember any rules regarding how the ! is expanded.

I used to use !:$ but Alt-. has taken over. Nothing like a general as
the !:3:h and so on, but useful enough that I've forgotten the old ways.

--
Ben.

Re: The angle bracket in an echo command???

<0qVzDKkDi+8Zi1cNu@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.unix.shell
Subject: Re: The angle bracket in an echo command???
Date: Fri, 16 Jun 2023 15:43:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <0qVzDKkDi+8Zi1cNu@bongo-ra.co>
References: <34694C8D.110316AD@bikerider.com> <e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com> <20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com> <u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<87mt10pcww.fsf@bsb.me.uk> <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 16 Jun 2023 15:43:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="95f7d79066a4f813f2b22980573a7e49";
logging-data="921679"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SSAZaIqYD2XwOVvXzhaT1"
Cancel-Lock: sha1:6jbFmLNUI4Qz41wb6QJVYRj0vLo=
X-Server-Commands: nowebcancel
In-Reply-To: <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
X-Organisation: Weyland-Yutani
 by: Spiros Bousbouras - Fri, 16 Jun 2023 15:43 UTC

Once upon a time
Spiros Bousbouras <spibou@gmail.com> wrote:
> On Thu, 15 Jun 2023 23:40:31 +0100
> Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
> > Ivan Shmakov <ivan@siamics.netNOSPAM.invalid> writes:
> > > > (*) Basically, either single or double quotes will protect angle
> > > > brackets, but you need single quotes to protect "!".
> > >
> > > It's also possible to disable history substitution altogether
> > > with 'set +H'.
> [...]
> > That's been my preference for some time. It was useful decades ago (in
> > csh if I recall correctly) but I never want it anymore.
>
> I use history substitution all the time. Most often I use !:$ or !:$:h or
> !:$:t with the $ occasionally replaced by a command number. I've never had
> to consciously remember any rules regarding how the ! is expanded.

Forgot : there is also the :r modifier and also the variation !-N where N
is some number. I also use a lot !prefix which finds the most recent command
which starts with prefix and !?string? which finds the most recent command
which contains string .

Re: The angle bracket in an echo command???

<87zg4yijoe.fsf@axel-reichert.de>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: mail@axel-reichert.de (Axel Reichert)
Newsgroups: comp.unix.shell
Subject: Re: The angle bracket in an echo command???
Date: Sat, 17 Jun 2023 10:20:49 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <87zg4yijoe.fsf@axel-reichert.de>
References: <34694C8D.110316AD@bikerider.com>
<e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com>
<20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<87mt10pcww.fsf@bsb.me.uk> <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
<87cz1vo53w.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ede9a1f788ab5cd632b81d8b5b8cb717";
logging-data="1251167"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+p5a8nzUf+LcrIo5QwywoTTsuhYGt//E="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:75O/QEIqMJHWYsr1xwPoUYTKl0w=
sha1:HKWHOcUnhY21cyoSJXOj45LS0DY=
 by: Axel Reichert - Sat, 17 Jun 2023 08:20 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> I used to use !:$ but Alt-. has taken over.

Ah! I did not know that, great, thanks!

So I can cover

sudo !!

with the even shorter (and funny!)

alias doch='sudo bash -c "$(fc -ln -1)"'

and

!$

with

M-. (interactive)

or

$_ (blind)

The other two tcsh left-overs, ^ (like in ^sl^ls) and !* are handled by

alias r='fc -s'

and

r sl=ls

Best regards

Axel

Re: The angle bracket in an echo command???

<u6ju04$16j85$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: The angle bracket in an echo command???
Date: Sat, 17 Jun 2023 11:22:02 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <u6ju04$16j85$1@dont-email.me>
References: <34694C8D.110316AD@bikerider.com>
<e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com>
<20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<87mt10pcww.fsf@bsb.me.uk> <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
<87cz1vo53w.fsf@bsb.me.uk> <87zg4yijoe.fsf@axel-reichert.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Jun 2023 09:22:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ed41a98b857f8fa2ea0835e677ae1412";
logging-data="1264901"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kyv4tBldlmSTtMeorODat"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:Wgf6y2tbbLccCFdFQm9CeErxRws=
In-Reply-To: <87zg4yijoe.fsf@axel-reichert.de>
Content-Language: en-US
 by: Janis Papanagnou - Sat, 17 Jun 2023 09:22 UTC

On 17.06.23 10:20, Axel Reichert wrote:
>
> The other two tcsh left-overs, ^ (like in ^sl^ls) and !* are handled by

(As the example shows, some typos seem to be quite common. :-)

> r sl=ls

While I know r and its substitution feature I seem to rarely use it in
practice.

As a vi-mode user in shell I use history editing with the vi emulation
almost exclusively. For the above case [intuitively] typing '<Esc>kxp'.
In this case it's shorter, but the 'r x=y' of course works also in more
complex substitution cases (as the built-in editor emulations also do).

Therefore I even "waste" some keystrokes at times, instead of a simple
'r<Enter>' I prefer to type '<Esc>k<Enter>'. I obviously avoid special
cases where a more general, powerful, and efficient option exists. The
special case implementations are fine if available for for common tasks,
especially when you start a new tool.

I gave up csh's '!' feature very early (when I switched to ksh88) and
rarely had a case for using ksh's 'r' feature.

Janis

Re: The angle bracket in an echo command???

<rwgcvc.lvgksw@bdesham.net>

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: usenet@esham.io (Benjamin Esham)
Newsgroups: comp.unix.shell
Subject: Re: The angle bracket in an echo command???
Date: Sun, 18 Jun 2023 10:25:15 -0400
Organization: United Federation of Planets
Lines: 26
Message-ID: <rwgcvc.lvgksw@bdesham.net>
References: <34694C8D.110316AD@bikerider.com>
<e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com>
<20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<87mt10pcww.fsf@bsb.me.uk> <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
<87cz1vo53w.fsf@bsb.me.uk> <87zg4yijoe.fsf@axel-reichert.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="c70aaefa7aab607bdf0adb9157ee3702";
logging-data="1774550"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sTuMftrjiiVNr+oDs6L7R9FQ976+vTUYeIqsHYE7OcA=="
User-Agent: Gnus/5.13 (macOS)
Cancel-Lock: sha1:OF9DfzTV+IGuJJUwDJ8fYuhAKfg=
sha1:tFygEkek3YtDZyXZ3RPXi8pwLjc=
 by: Benjamin Esham - Sun, 18 Jun 2023 14:25 UTC

Axel Reichert wrote:

> So I can cover [snip]
>
> !$
>
> with
>
> M-. (interactive)
>
> or
>
> $_ (blind)

Zsh supports the csh-style !$ and friends (as long as you have the BANG_HIST
option set, which it is by default), but it also allows you to type <Tab>
after something like !$, in which case it will expand it immediately so that
you don't have to run the command blind. (This is especially useful with
constructions like !!:3, where I always wonder if I miscounted the words in
the previous line, or if I'm misremembering whether the counting is zero- or
one-based.)

On the other hand, M-. also seems to work in Zsh, and it's fewer keystrokes
than !$<Tab>. I'll try to remember it next time I need this!

Benjamin

Re: The angle bracket in an echo command???

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

  copy mid

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

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!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: The angle bracket in an echo command???
Date: Sun, 18 Jun 2023 15:34:54 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <87bkhcn8j5.fsf@bsb.me.uk>
References: <34694C8D.110316AD@bikerider.com>
<e0f64401-6ab2-4487-bd81-62bee26d9406n@googlegroups.com>
<20230513093439.9efb791c12665517e1dd466c@127.0.0.1>
<51d52d53-aacf-40da-8de2-8f26e79783cen@googlegroups.com>
<u6d477$vron$1@news.xmission.com> <u6fvb9$hdk2$1@dont-email.me>
<87mt10pcww.fsf@bsb.me.uk> <2ZOMvYVxe0ck+Wtiz@bongo-ra.co>
<87cz1vo53w.fsf@bsb.me.uk> <87zg4yijoe.fsf@axel-reichert.de>
<rwgcvc.lvgksw@bdesham.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="7a75cb483dc6e4debc7768d778100d3a";
logging-data="1774702"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jI1SIAL3MTNYnL16LowCG35xMztm3EWk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:5dlKEtH4I/dIjJxtiz0WkeZ68Uw=
sha1:GSO+w28i3L9oS2ytKfo0lty7tPc=
X-BSB-Auth: 1.5613c318cfeeaa7f0630.20230618153454BST.87bkhcn8j5.fsf@bsb.me.uk
 by: Ben Bacarisse - Sun, 18 Jun 2023 14:34 UTC

Benjamin Esham <usenet@esham.io> writes:

> On the other hand, M-. also seems to work in Zsh, and it's fewer keystrokes
> than !$<Tab>. I'll try to remember it next time I need this!

I find M-. so handy that it's influenced my working. I now, almost
unconsciously, arrange that the argument I am likely to use soon is
the last.

It's a shame that, as far as I know, there is no way to interactively
cycle round the command arguments. Having found the last argument on
the command I want, I'd sometimes like to get the next to last and so
on. M-, maybe? I wonder if it would be worth trying to write such a
patch...

--
Ben.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor