From owner-freebsd-hackers Sat Oct 20 14:44:52 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from freebie.xs4all.nl (freebie.xs4all.nl [213.84.32.253]) by hub.freebsd.org (Postfix) with ESMTP id D2CA937B401 for ; Sat, 20 Oct 2001 14:44:46 -0700 (PDT) Received: (from wkb@localhost) by freebie.xs4all.nl (8.11.6/8.11.6) id f9KLiUo00609; Sat, 20 Oct 2001 23:44:30 +0200 (CEST) (envelope-from wkb) Date: Sat, 20 Oct 2001 23:44:30 +0200 From: Wilko Bulte To: Rod Person Cc: Hackers FreeBSD Subject: Re: bash scripting help/suggestions. Message-ID: <20011020234430.A568@freebie.xs4all.nl> References: <20011020173545.6cf189ff.roddierod@hotpop.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011020173545.6cf189ff.roddierod@hotpop.com>; from roddierod@hotpop.com on Sat, Oct 20, 2001 at 05:35:45PM -0400 X-OS: FreeBSD 4.4-STABLE X-PGP: finger wilko@freebsd.org 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, Oct 20, 2001 at 05:35:45PM -0400, Rod Person wrote: man test(1) tells you how to check for a directory (and lots more BTW) mkdir -p might also interest you (see the mkdir man page) > 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 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 ---end of quoted text--- -- | / o / /_ _ email: wilko@FreeBSD.org |/|/ / / /( (_) Bulte Arnhem, The Netherlands To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message