From owner-freebsd-questions@FreeBSD.ORG Mon Jul 14 21:09:27 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01082106566C for ; Mon, 14 Jul 2008 21:09:27 +0000 (UTC) (envelope-from dkelly@Grumpy.DynDNS.org) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by mx1.freebsd.org (Postfix) with ESMTP id 5E8E98FC13 for ; Mon, 14 Jul 2008 21:09:25 +0000 (UTC) (envelope-from dkelly@Grumpy.DynDNS.org) Received: (qmail 27019 invoked by uid 0); 14 Jul 2008 21:09:24 -0000 Received: from unknown (HELO Grumpy.DynDNS.org) (216.186.148.249) by smtp8.knology.net with SMTP; 14 Jul 2008 21:09:24 -0000 Received: by Grumpy.DynDNS.org (Postfix, from userid 928) id 5C27D28429; Mon, 14 Jul 2008 16:09:24 -0500 (CDT) Date: Mon, 14 Jul 2008 16:09:24 -0500 From: David Kelly To: Gary Kline Message-ID: <20080714210924.GA16869@Grumpy.DynDNS.org> References: <20080714201241.GA22443@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080714201241.GA22443@thought.org> User-Agent: Mutt/1.4.2.3i Cc: FreeBSD Mailing List Subject: Re: why is this script failing? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2008 21:09:27 -0000 On Mon, Jul 14, 2008 at 01:12:47PM -0700, Gary Kline wrote: > > why is this script not finding them? > > > wav=/tmp/kde-kline/\*wav\* > > if [ -s $wav ] As others have pointed out because if "/tmp/kde-kline/file1.wav /tmp/kde-kline/file2.wav" is found the -s will fail because $wav isn't a single file. Or it could be that your escaped wildcards are staying escaped. I use something like this to move files out of a Maildir: #!/bin/sh for i in /tmp/kde-kline/*wav do # if nothing or nonsense was found then $i won't exist if [ -e $i ] then echo "Found " $i /bin/rm $i fi done But why do it the hard way? #!/bin/sh /bin/rm /tmp/kde-kline/*wav > /dev/null 2>&1 -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.