bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Here strings and pathname expansion


From: Jan Schampera
Subject: Here strings and pathname expansion
Date: Mon, 14 Feb 2011 06:43:50 +0100
User-agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329)

Hello world,


I recently answered a question about using the asterisk mixed with redirection and other words. This also lead me to the documentation that states (REDIRECTION section):

---
The word following the redirection operator in the following descriptions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expansion, quote removal, pathname expansion, and word splitting. If it expands to more than one word, bash reports an error.
---

This is true, for here documents the exceptions are mentioned. However, for here strings no exceptions are mentioned ("The WORD is expanded [...]]", but the WORD is at least not subject to pathname expansion:

$ cat <<< *
*

This is EITHER
(a) a documentation mistake OR
(b) a bug

Case (a) is clear, the exception is not mentioned.

Case (b) is also possible, because it COULD be intended to pathname-expand WORD:
(1) error out if pathname expansion results in more than one word OR
(2) use the first word of the result OR
(3) pass all results (as a special case)

I would expect the thing to either be (a) or (b)(2).

--
Be conservative in what you do, be liberal in what you accept from others.
- jbp, master of the net, in RFC793




reply via email to

[Prev in Thread] Current Thread [Next in Thread]