help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] The best way to test whether a directory has *.txt files


From: Clark WANG
Subject: Re: [Help-bash] The best way to test whether a directory has *.txt files?
Date: Thu, 28 Jun 2012 16:44:49 +0800

On Thu, Jun 28, 2012 at 11:27 AM, Peng Yu <address@hidden> wrote:
Hi,

There can be more than one way to test whether a directory contains
*.txt files (to be used with 'find -exec'). But I'm wondering what is
the best way (in terms of convenience to type) to do it. Does anybody
have any tricks on this?

I've ever seen this:

( shopt -s nullglob; set -- /the/dir/*.txt; (( $# )) )
 

--
Regards,
Peng



reply via email to

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