From owner-freebsd-questions Wed Jan 13 13:28:57 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA04508 for freebsd-questions-outgoing; Wed, 13 Jan 1999 13:28:57 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA04471 for ; Wed, 13 Jan 1999 13:28:46 -0800 (PST) (envelope-from ben@scientia.demon.co.uk) Received: from ben by scientia.demon.co.uk with local (Exim 2.10 #3) id 100QHe-000KRU-00; Wed, 13 Jan 1999 13:24:30 +0000 Date: Wed, 13 Jan 1999 13:24:30 +0000 From: Ben Smithurst To: cjclark@home.com Cc: FreeBSD Questions Subject: Re: Documentation of '[]' Message-ID: <19990113132430.A78574@scientia.demon.co.uk> References: <199901130625.BAA04054@cc942873-a.ewndsr1.nj.home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <199901130625.BAA04054@cc942873-a.ewndsr1.nj.home.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Crist J. Clark wrote: > You get the 'test(1)' manpage as you should, but there is no mention > of how and when '[]' can be used instead of 'test.' Anywhere. There is no difference, except that you must use a "]" as the last argument with "]", you don't with "test". (i.e., test -f /foo [ -f /foo ] are the same. [ -f /foo test -f /foo ] are syntax errors. But you knew that.) There may be another difference, I think some shells may have one or both as a shell builtin, though it's likely to affect both and so won't affect your choice of which to use. I prefer "[ ... ]" since it looks nicer IMO, but YMMV. -- Ben Smithurst ben@scientia.demon.co.uk send a blank message to ben+pgp@scientia.demon.co.uk for PGP key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message