From owner-freebsd-hackers Sat Oct 20 14:41:26 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from kitkat.hotpop.com (kitkat.hotpop.com [204.57.55.30]) by hub.freebsd.org (Postfix) with ESMTP id 6B5E437B405 for ; Sat, 20 Oct 2001 14:41:24 -0700 (PDT) Received: from hotpop.com (unknown [204.57.55.31]) by kitkat.hotpop.com (Postfix) with SMTP id 1A089308C6 for ; Sat, 20 Oct 2001 21:41:13 +0000 (UTC) Received: from hotpop.com (shiva-dhcp-101.dial.upmc.edu [128.147.34.101]) by zagnut.hotpop.com (Postfix) with SMTP id 755CD50014 for ; Sat, 20 Oct 2001 21:40:04 +0000 (UTC) Date: Sat, 20 Oct 2001 17:35:45 -0400 From: Rod Person To: Hackers FreeBSD Subject: bash scripting help/suggestions. Message-Id: <20011020173545.6cf189ff.roddierod@hotpop.com> Reply-To: roddierod@hotpop.com Organization: Open Source Beef X-Mailer: Sylpheed version 0.6.1 (GTK+ 1.2.8; i386--freebsd4.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- 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 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