Chet Ramey wrote:
Yang Zhang wrote:
Hi, why doesn't the second command work? (Trying to move all files into
a newly created directory.)
$ mkdir dhclient
$ mv !(dhclient) !$
bash: !: event not found
It doesn't work because enabling the `extglob' option doesn't cause bash
to tell the history library to not attempt history expansion when it sees
the history expansion character followed by a `('. This will be fixed in
bash-4.0 or soon after.
Chet
So it's failing on the first bang? But there is no problem once I
replace !$ with 'dhclient' - usually extglob seems to work fine with the
suppression of history expansion. Or does the presence of !$ somehow
trigger history expansion (normally not run) which then attempts to
history-expand everything?
--
Yang Zhang
http://www.mit.edu/~y_z/