Linux expr command vs. FreeBSD version

Brooks Davis brooks at one-eyed-alien.net
Thu May 4 22:05:17 UTC 2006


On Thu, May 04, 2006 at 04:17:21PM -0400, Kris Kennaway wrote:
> On Thu, May 04, 2006 at 01:08:34PM -0700, Sean McNeil wrote:
> > On Thu, 2006-05-04 at 15:48 -0400, Kris Kennaway wrote:
> > > On Thu, May 04, 2006 at 10:33:03AM -0700, Sean McNeil wrote:
> > > > On Thu, 2006-05-04 at 12:49 -0400, Kris Kennaway wrote:
> > > > > On Tue, May 02, 2006 at 03:50:40PM -0700, Sean McNeil wrote:
> > > > > > 
> > > > > > I ran into a problem with paths when running linux emulation.  It
> > > > > > appears that when looking for a file, linux emulation will first
> > > > > > try /compat/linux/path and if not found, /path.  This causes grief with
> > > > > > expr as the Linux version supports enhancements like "expr match"
> > > > > > whereas the FreeBSD version does not.  To get around the issue, I put a
> > > > > > symlink in /compat/linux/bin/expr -> /compat/linux/usr/bin/expr. I don't
> > > > > > know of any better solution.  Anyone?
> > > > > 
> > > > > Why is this an issue for you?
> > > > 
> > > > Like I said, the FreeBSD expr command doesn't support things like "expr
> > > > match".  FreeBSD puts expr in /bin and Linux puts it in /usr/bin.
> > > > Appropriately, my path looks at /bin before /usr/bin.
> > > > 
> > > > I have scripts that run perfect on a Linux machine and fail on FreeBSD
> > > > with Linux emulation because they use that very feature.
> > > 
> > > Or just run the script in a chroot (chroot /compat/linux /bin/bash
> > > /your/script) so it doesn't see the FreeBSD filesystem at all.  This
> > > is the only safe way to do it, really - there may be other differences
> > > that will cause more subtle aliasing problems.
> > 
> > This is what I was asking (a better solution?)
> 
> Yeah, that's why I needed to find out what your actual problem was
> first :-)
> 
> >, but unfortunately you
> > have to be superuser to change the root directory whereas I want to run
> > things as a normal user.
> 
> Oh well, I don't think there's much you can do here as a normal user.

There's always installing sysutils/coreutils and using gexpr or adding a
symlink to ~/bin and making that come before /bin in your path.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-emulation/attachments/20060504/734a47f3/attachment.pgp


More information about the freebsd-emulation mailing list