[Top][All Lists]

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

Re: Quick question: mv !(file) !$

From: Yang Zhang
Subject: Re: Quick question: mv !(file) !$
Date: Tue, 13 Jan 2009 04:34:15 -0500
User-agent: Thunderbird (X11/20090105)

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.


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

reply via email to

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