From: Ben Bacarisse on
Lao Ming <laomingliu(a)gmail.com> writes:

> I want to list all the images in a directory but no other files. If I
> try e.g.:
>
> ls -al *.jpg *.png *.gif
>
> I can get a failure if there is, e.g. no GIF.

Does *.{jpg,png,gif} meet your needs? It, too, fails if there is no
match but this might be a good thing.

<snip>
--
Ben.
From: Ben Bacarisse on
Janis Papanagnou <janis_papanagnou(a)hotmail.com> writes:

> On 13/07/10 02:54, Ben Bacarisse wrote:
>> Lao Ming <laomingliu(a)gmail.com> writes:
<snip>
>>> I can get a failure if there is, e.g. no GIF.
>>
>> Does *.{jpg,png,gif} meet your needs? It, too, fails if there is no
>> match but this might be a good thing.
>
> But that way you get exactly the same error message as with the OP's
> command, and the OP explicitly said he wants to avoid the error
> message.

Ha! So it does. I wonder where I got the idea that it did not? I
think it would be better if the shell behaved as I have imagined it, but
that does not change the fact that at least some do not.

Thanks for spotting that.

--
Ben.