How can I do this in bash?
find . -name '*!{*}*' -ls
Cf. UNIX Power Tools, page 175.
This works in tcsh, but no in bash.
In bash I get this message:
ff CH18
find: paths must precede expression
Usage: find [-H] [-L] [-P] [expression]
Software/Hardware used:
ASKED:
June 6, 2009 2:39 AM
UPDATED:
June 15, 2009 4:44 PM
Thank you, Djeepp.
I downloaded bash 4.0 and now I get data, but it is way more than I expect.
Basically a find . -print.
???/
Hi,
this message basically means that some parameter expansion happened in the shell and expanded parameter to -name confused find.
In this example I would backslah-escape the curly brackets… though tested it in bash 3.0, and it works in your original syntax…
What was you initial bash version?
BR,
Petko
Hello, Petkoa
Here’s the answer to your version question:
GNU bash, version 3.2.13(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
Well, then – it works with 3.0 and 4.0 – there should be no reasons not to work under 3.2 (at least I can’t recall any changes in quoting/escaping that took place after 3.0 (and were reversed in 4.0)… The find expression may not work in double-quotes (though, in my environment it works), but should work in single-quiotes, as you posted it. I’m really puzzled.
BR,
Petko