From owner-freebsd-hackers Sat Oct 20 15: 3:18 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from saruman.xwin.net (saruman.xwin.net [205.219.158.250]) by hub.freebsd.org (Postfix) with ESMTP id 21FA337B405 for ; Sat, 20 Oct 2001 15:03:16 -0700 (PDT) Received: from localhost (dp@localhost) by saruman.xwin.net (8.11.4/8.9.1) with ESMTP id f9KH3c720586; Sat, 20 Oct 2001 12:03:38 -0500 Date: Sat, 20 Oct 2001 12:03:38 -0500 (CDT) From: Paul Halliday X-X-Sender: To: Rod Person Cc: Hackers FreeBSD Subject: Re: bash scripting help/suggestions. In-Reply-To: <20011020173545.6cf189ff.roddierod@hotpop.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG on Sat, 20 Oct 2001, Rod Person wrote: > I'm creating a bash script and I need to know if a directory exists > and if it doesn't create it. So far the only why I can see to > determine if a directory exists is to try to cd to it and if it > doesn't exists trap the error. Is there a better way or a function > that I am missing? If not how do you trap a error in bash, if at all if [ -d $dir ]; then ; else mkdir $dir; fi > possible. > > Rod > > http://storm.prohosting.com/osbeef/osbeef.htm > > '....musical rhythms can mess with your head...' > - T La Rock > "It's your's" > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Paul H. "Don't underestimate the power of stupid people in large groups" ___________________ http://dp.penix.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message