From owner-freebsd-questions@FreeBSD.ORG Mon Jul 29 14:07:31 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0D018FB for ; Mon, 29 Jul 2013 14:07:31 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ee0-x22e.google.com (mail-ee0-x22e.google.com [IPv6:2a00:1450:4013:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 956222881 for ; Mon, 29 Jul 2013 14:07:30 +0000 (UTC) Received: by mail-ee0-f46.google.com with SMTP id c13so371518eek.5 for ; Mon, 29 Jul 2013 07:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=CukWF5SgOh9dFCH0K4Nm0BfSqEbWUb6jK58Z9W0EXgY=; b=0KvdJVSFNN5JZ6uuSBubjQwbZ9RMz4n0H4Wqi6MzeQawu9m6lfolAMOVygkAoo7d3b SJ0S8QPEcsaq1XP+/GDWJ5ZDB1WALn0D7xTYn5bq+s4+uAFiwwElpFF+O69LTp6QPHap EKA847EDj+tdd3qVMYgtk+hXElf57wylJLc0qGuB4mHU0zt7QD8Kaa3s/QKoSBKE9Pqx Kn8oqnSxEGUO3c9lWCcQqbwX9BGQN4s9FlXD2xpQURHDmZ8zKTmOTedMb6AT4rI+NDff 4ypN6vZnVdKMWvlh3p7/fIN+RY2hi/Z3lIy8m6VKqewmTeEV2dayd5gQdT4WC07UIn8W oFkw== X-Received: by 10.15.53.4 with SMTP id q4mr60395076eew.134.1375106848787; Mon, 29 Jul 2013 07:07:28 -0700 (PDT) Received: from gumby.homeunix.com (87-194-105-247.bethere.co.uk. [87.194.105.247]) by mx.google.com with ESMTPSA id cg12sm102445791eeb.7.2013.07.29.07.07.27 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Mon, 29 Jul 2013 07:07:28 -0700 (PDT) Date: Mon, 29 Jul 2013 15:07:27 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: Unusual file: /bin/[ Message-ID: <20130729150727.121517d2@gumby.homeunix.com> In-Reply-To: <51F66D34.8010803@ifdnrg.com> References: <51F66D34.8010803@ifdnrg.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.17; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:07:31 -0000 On Mon, 29 Jul 2013 14:25:08 +0100 Paul Macdonald wrote: > > Hi, I spotted what i'd call an unusual file in the basejail on a jail > install, and have since seen this on other non jailed boxes. > > -r-xr-xr-x 2 root wheel 11488 Jun 10 12:19 [ > > man [ reveals > > test, [ -- condition evaluation utility > > just checking thats all ok, and i've not been rooted! The idea was to make shell scripts more readable as you can have something like: if [ ${x} -gt 1 ] ... [ is a hard-link to /bin/test and the closing] "]" is its last argument. In most modern shells its a builtin feature and /bin/[ isn't used.