[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] weird "find" behavior
- Subject: [ale] weird "find" behavior
- From: yahoo at jimpop.com (Jim Popovitch)
- Date: Sun Dec 2 01:31:21 2007
- In-reply-to: <[email protected]>
- References: <1196552522.11773.2.camel@localhost> <[email protected]> <1196575476.28571.1.camel@localhost> <[email protected]>
On Sun, 2007-12-02 at 01:27 -0500, Brian Pitts wrote:
> > Right, but why does *.c work BUT not *.h, both without shell expansion
> > (which is what my WTF was all about).
> >
> > -Jim P.
>
> *.c works because there are no files ending in .c for the shell to
> expand that expression to. *.h fails because there are. Like Greg said
>
> "If the current directory has no *.c files, then your first command
> works by chance.
>
> If it has some *.h files, then it fails due to standard shell
> expression expansion."
>
> In other words,
>
> ls | grep "\.c"
>
> returns nothing, whereas
>
> ls | grep "\.h"
>
> shows something.
>
> You can verify that shell expansion is taking place using strace.
Doh! I saw "shell expansion" and thought "quoted text" (doing 3 things
at the same time right now...)
Thanks Brian and Greg.
-Jim P.