From owner-freebsd-questions Fri Feb 7 17:39:01 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id RAA16708 for questions-outgoing; Fri, 7 Feb 1997 17:39:01 -0800 (PST) Received: from cedb.dpcsys.com (CEDB.DPCSYS.com [207.124.154.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA16703 for ; Fri, 7 Feb 1997 17:38:58 -0800 (PST) Received: from localhost (dan@localhost) by cedb.dpcsys.com (8.8.2/8.8.2) with SMTP id BAA03774; Sat, 8 Feb 1997 01:23:38 GMT Date: Fri, 7 Feb 1997 17:23:37 -0800 (PST) From: Dan Busarow To: David Chamberlain cc: freebsd-questions@freebsd.org Subject: Re: Stupid shell question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 7 Feb 1997, David Chamberlain wrote: > I am trying to write an if statement in a shell script that executes a > series of lines if *any* file exists in a specified directory. Ie: > > if [ file exists in send dir ] cd sned_dir for i in * # if send_dir is empty $i gets set to a literal "*" do if [ -f $i ] # make sure $i is a regular file then do this and this fi done Have fun Dan -- Dan Busarow 714 443 4172 DPC Systems / Beach.Net dan@dpcsys.com Dana Point, California 83 09 EF 59 E0 11 89 B4 8D 09 DB FD E1 DD 0C 82