From owner-freebsd-questions@FreeBSD.ORG Sat Mar 27 06:51:06 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034D6106566C for ; Sat, 27 Mar 2010 06:51:06 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email1.allantgroup.com (email1.emsphone.com [199.67.51.115]) by mx1.freebsd.org (Postfix) with ESMTP id BE4BE8FC14 for ; Sat, 27 Mar 2010 06:51:05 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email1.allantgroup.com (8.14.0/8.14.0) with ESMTP id o2R6p2gd039391 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 27 Mar 2010 01:51:02 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.4/8.14.3) with ESMTP id o2R6p2av059367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 27 Mar 2010 01:51:02 -0500 (CDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.4/8.14.3/Submit) id o2R6p1Xa059366; Sat, 27 Mar 2010 01:51:01 -0500 (CDT) (envelope-from dan) Date: Sat, 27 Mar 2010 01:51:01 -0500 From: Dan Nelson To: Manish Jain Message-ID: <20100327065100.GA4806@dan.emsphone.com> References: <4BAE5627.5010802@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BAE5627.5010802@gmail.com> X-OS: FreeBSD 8.0-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.95.3 at email1.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (email1.allantgroup.com [199.67.51.78]); Sat, 27 Mar 2010 01:51:02 -0500 (CDT) X-Scanned-By: MIMEDefang 2.45 Cc: freebsd-questions@freebsd.org Subject: Re: Question about expr X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2010 06:51:06 -0000 In the last episode (Mar 27), Manish Jain said: > I am used to the normal GNU-version of expr (also available on Solaris) > and much prefer it over the FreeBSD version. The GNU version allows > internal commands like length, substring and others which make it much > easier to work with. Is there any way I can replace FreeBSD's native expr > with the GNU version ? Since I believe expr does not normally ship as a > shell-builtin, I don't think the shell can of much help in the matter. > > Actually, I think it might not be a bad idea to place a port of GNU-expr > in the ports directory. This would allow a lot a scripts to be readily > portable to multiple environments. It's part of the coreutils package. If you install the sysutils/coreutils port, you can symlink /bin/expr over to it (or make a copy). I don't know if it's 100% compatible with BSD expr, though, so you may end up breaking scripts in the base system. -- Dan Nelson dnelson@allantgroup.com