Pierre Abbat wrote: > On Monday 01 February 2010 12:07:28 Oliver Fromme wrote: > > The "which" command (whether shell-builtin or /usr/bin/which > > doesn't matter) simply looks at the PATH environment variable: > > It opens every directory, one after another, and looks for > > the binary. It is first found in /usr/pkg/bin. Note that > > the linuxulator doesn't redirect the directory because > > /compat/linux/usr/pkg/bin doesn't exist. So the "which" > > command prints /usr/pkg/bin/bash. The same happens when > > you type "/usr/pkg/bin/bash" because this path doesn't exist > > under /compat/linux, so you'll get the DFly bash. > > [...] > > /bin is before /usr/pkg/bin in $PATH, so that's not why.
Ok, I assumed that you had /usr/pkg/bin at the front. Unfortunately I don't have a DFly box with Linux_base installed, so I thought it works the same as on on my FreeBSD machine, where the Linux bash has "which" as a function that comes from this file: /compat/linux/usr/share/doc/bash-3.0/functions/which This function uses bash's builtin "type" command to implement the "which" command. Since this is executed by the linux bash, it finds /bin/bash if /bin is at the front of the $PATH, of course. That's why I made the initial assumption that you had /usr/pkg/bin at the front instead. :-) Of course, if your linux bash executes /usr/bin/which (which is a BSD binary, not a script), then it will not look at /compat/linux at all when looking for a program. If it was a shell script, things would be different. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd
