From owner-freebsd-emulation@FreeBSD.ORG Thu May 4 17:33:07 2006 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 422B616A414 for ; Thu, 4 May 2006 17:33:07 +0000 (UTC) (envelope-from sean@mcneil.com) Received: from mail.mcneil.com (mcneil.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id C04F243D62 for ; Thu, 4 May 2006 17:33:04 +0000 (GMT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id 91DE3F27B1; Thu, 4 May 2006 10:33:04 -0700 (PDT) X-Virus-Scanned: by amavisd-new at mcneil.com Received: from mail.mcneil.com ([127.0.0.1]) by localhost (triton.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBgksHGe4j9f; Thu, 4 May 2006 10:33:04 -0700 (PDT) Received: from mcneil.com (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id 2C23FF18C8; Thu, 4 May 2006 10:33:04 -0700 (PDT) From: Sean McNeil To: Kris Kennaway In-Reply-To: <20060504164959.GA67641@xor.obsecurity.org> References: <1146610240.80438.4.camel@triton.mcneil.com> <20060504164959.GA67641@xor.obsecurity.org> Content-Type: text/plain Date: Thu, 04 May 2006 10:33:03 -0700 Message-Id: <1146763983.98779.12.camel@triton.mcneil.com> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: emulation@freebsd.org Subject: Re: Linux expr command vs. FreeBSD version X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2006 17:33:10 -0000 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. It is completely silly to have to change my scripts to be "/usr/bin/expr match", so the solution I use is to put the symlink in the Linux environment so that /bin/expr chooses the Linux version of expr (/usr/bin/expr). Cheers, Sean