!$ works with `` but not $()
Bug #791263 reported by
Ralph Corderoy
This bug affects 1 person
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| bash (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
Bug Description
Binary package hint: bash
This is on 10.04 and also with upstream's pure bash 4.2 with no Debian or Ubuntu patches.
$ echo bar >foo
$ >bar
$ ls `cat foo`
bar
$ wc !$
wc `cat foo`
0 0 0 bar
$ ls $(cat foo)
bar
$ wc !$
wc )
-bash: syntax error near unexpected token `)'
$ ls $(<foo)
bar
$ wc !$
wc )
-bash: syntax error near unexpected token `)'
$
I'd expect !$ to consider the last word to be $(...) just as it is happy with `...`. zsh does.
To post a comment you must log in.

bash's upstream maintainer Chet Ramey confirms the bug and says it will be fixed in the next release. http:// lists.gnu. org/archive/ html/bug- bash/2011- 06/msg00003. html