Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Change interactive command into a comment
- X-seq: zsh-users 24427
- From: Ben Klein <robobenklein@xxxxxxxxx>
- To: Perry Smith <pedz@xxxxxxxxxxxxxxxx>
- Subject: Re: Change interactive command into a comment
- Date: Wed, 13 Nov 2019 20:15:26 -0500
- Cc: zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=m+2QZ3Vqm8oKBOfK/Vp5I/WzNuy2znkPWs/DbmcSEIQ=; b=Yr48W11Xj+Betu76Z+xDxNMb/BI7ag4oZF0twTiEkf7XiYKx4Aoz50BmF21elyizt9 pY+Y9jEWGw3QYHT6kxOG8H0/aCClf6/4F3qDpNkYfHHG7HK1TiNc8NigBGULd9x+ZERE pxzqpYSPQ2TF04M9gWv9RTHZ+JJ4FYcuH/8/m/B00gowtofa4CXHz4B6IJBhZWyFvV99 /MldFVex0hHs847b4SQCFZ0I0K3swnnJw4BKaG9fnSlYjqmSWYpQo9d9M9RLTwmu1H8E Kkqd7nLc7xTTNehx4cFTg91TCTfnzEbp8leIcFzQibxHl4Slz+3Cw9LDfuwBglXV44Wi WqWg==
- In-reply-to: <AE14DF7F-5C34-4D14-A20A-8356C547E114@easesoftware.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AE14DF7F-5C34-4D14-A20A-8356C547E114@easesoftware.com>
The answer to that (assuming extended_glob) is way at the bottom of the
Expansion docs:
http://zsh.sourceforge.net/Doc/Release/Expansion.html#Filename-Generation
To quote directly:
x#
(Requires EXTENDED_GLOB to be set.) Matches zero or more occurrences of the
pattern x. This operator has high precedence; ‘12#’ is equivalent to
‘1(2#)’, rather than ‘(12)#’. It is an error for an unquoted ‘#’ to follow
something which cannot be repeated; this includes an empty string, a
pattern already followed by ‘##’, or parentheses when part of a KSH_GLOB
pattern (for example, ‘!(foo)#’ is invalid and must be replaced by
‘*(!(foo))’).
x##
(Requires EXTENDED_GLOB to be set.) Matches one or more occurrences of the
pattern x. This operator has high precedence; ‘12##’ is equivalent to
‘1(2##)’, rather than ‘(12)##’. No more than two active ‘#’ characters may
appear together. (Note the potential clash with glob qualifiers in the form
‘1(2##)’ which should therefore be avoided.)
*\Ben Klein*
About: https://unhexium.net/about/
Other places online: https://unhexium.net/ll/
Contact me securely: https://keybase.io/robobenklein
On Wed, Nov 13, 2019 at 7:25 PM Perry Smith <pedz@xxxxxxxxxxxxxxxx> wrote:
> With bash, I got into the following habit. If I started typing a long
> command and then decided I didn’t want to execute it right now for some
> reason, I would hit control-A to get back to the start of the line and then
> add a # in front and hit return.
>
> This would put the command into history and so later I could recall it,
> remove the #, and execute the command.
>
> With zsh, when I add the # to the front and hit return I get:
>
> zsh: bad pattern: #
>
> I found INTERACTIVE_COMMENTS but now I’m curious, what is zsh trying to do
> with a line starting with # ? e.g. # echo dog
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author