[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: best way to test for empty dir?
From: |
Chris F.A. Johnson |
Subject: |
Re: best way to test for empty dir? |
Date: |
Fri, 11 Dec 2009 09:21:10 -0500 (EST) |
User-agent: |
Alpine 2.00 (LMD 1167 2008-08-23) |
On Fri, 11 Dec 2009, Antonio Macchi wrote:
> is_file()
> {
> [ -f "$1" ] && return
> return 1
> }
>
> is_file /path/to/dir/* || echo empty
>
>
>
> you don't need to check more than the first element
You may need to; it depends on the statement of the problem.
--
Chris F.A. Johnson, webmaster <http://woodbine-gerrard.com>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
- Re: best way to test for empty dir?, (continued)
- Re: best way to test for empty dir?, Marc Herbert, 2009/12/14
- Re: best way to test for empty dir?, Matias A. Fonzo, 2009/12/14
- Re: best way to test for empty dir?, Andreas Schwab, 2009/12/15
- Re: best way to test for empty dir?, Matias A. Fonzo, 2009/12/15
- Re: best way to test for empty dir?, Andreas Schwab, 2009/12/15
- Re: best way to test for empty dir?, Matias A. Fonzo, 2009/12/15
- Message not available
- Re: best way to test for empty dir?, Antonio Macchi, 2009/12/15
- Message not available
- Re: best way to test for empty dir?, Stephane CHAZELAS, 2009/12/12
- Re: best way to test for empty dir?, Stephane CHAZELAS, 2009/12/12
Message not available
Message not available