Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: unquoted expansion not working (was Re: Not missing, but very hard to see) Date: Fri, 13 Dec 2019 13:42:13 -0500 Lines: 44 Approved: bug-bash@gnu.org Message-ID: References: <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> <21761e28-c496-ff67-d7b7-628c9325085f@iki.fi> <9dd3a388-39b1-c059-de99-813f1e411764@case.edu> <5DF2987E.5000309@tlinx.org> <568aeaaa-22b3-c7b9-0e18-a92bef6d2ffb@iki.fi> <5DF2FE31.9070406@tlinx.org> <0ff3a920-94c2-b0c9-5631-0964955657aa@archlinux.org> <5DF3D78B.4090208@tlinx.org> <20191213184213.GO851@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1576262540 7138 209.51.188.17 (13 Dec 2019 18:42:20 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org Mail-Followup-To: bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <5DF3D78B.4090208@tlinx.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20191213184213.GO851@eeg.ccf.org> X-Mailman-Original-References: <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> <21761e28-c496-ff67-d7b7-628c9325085f@iki.fi> <9dd3a388-39b1-c059-de99-813f1e411764@case.edu> <5DF2987E.5000309@tlinx.org> <568aeaaa-22b3-c7b9-0e18-a92bef6d2ffb@iki.fi> <5DF2FE31.9070406@tlinx.org> <0ff3a920-94c2-b0c9-5631-0964955657aa@archlinux.org> <5DF3D78B.4090208@tlinx.org> Xref: csiph.com gnu.bash.bug:15728 On Fri, Dec 13, 2019 at 10:25:15AM -0800, L A Walsh wrote: > I would assert that for the characters returned by a range that has > metacharacters in it, the metacharacters SHOULD be quoted or they will not > appear in the output. There's a larger issue to be addressed first. The man page says, A sequence expression takes the form {x..y[..incr]}, where x and y are either integers or single characters, and incr, an optional increment, is an integer. When integers are supplied, the expression expands to each number between x and y, inclusive. Supplied integers may be pre‐ fixed with 0 to force each term to have the same width. When either x or y begins with a zero, the shell attempts to force all generated terms to contain the same number of digits, zero-padding where neces‐ sary. When characters are supplied, the expression expands to each character lexicographically between x and y, inclusive, using the de‐ fault C locale. But {x..y} does NOT work for most characters in the first place. wooledg:~$ echo {<..>} wooledg:~$ echo {:..?} {:..?} wooledg:~$ echo {^..|} bash: syntax error near unexpected token `}' wooledg:~$ cat } { wooledg:~$ rm } wooledg:~$ So, the first issue to be addressed is whether the man page is wrong, and should say "letters" rather than "characters", or whether the man page is correct, and the shell should be generating these punctuation characters as output. If Chet decides that the man page's wording is correct, then I agree with you here. The generated punctuation characters should be usable in the same way that generated digits or letters are usable. If on the other hand Chet decides that the man page's wording is not accurate, then the issue about whether to quote punctuation characters becomes irrelevant. The generation of punctuation characters is an unexpected consequence, and the answer is Don't Do That.