Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Mar 2010 01:51:01 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Manish Jain <invalid.pointer@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Question about expr
Message-ID:  <20100327065100.GA4806@dan.emsphone.com>
In-Reply-To: <4BAE5627.5010802@gmail.com>
References:  <4BAE5627.5010802@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100327065100.GA4806>