Mailinglist Archive: opensuse (527 mails)

< Previous Next >
Re: [opensuse] which which?
On Tue, Aug 30, David Haller wrote:
Hello,

On Tue, 30 Aug 2016, Neil Rickert wrote:
On 08/29/2016 08:30 PM, Michael Fischer wrote:

Once upon a time, SuSE had a which(1) which was actually type(1) with "
-a".

Nope.

==== openSUSE-10.2 : aaa_base-10.2-38.i586.rpm : /etc/bash.bashrc ====
if test "$is" = "bash" ; then
#
# Other shells use the which command in path (e.g. ash) or
# their own builtin for the which command (e.g. ksh and zsh).
#
_which () {
local file=$(type -p ${1+"$@"} 2>/dev/null)
if test -n "$file" -a -x "$file"; then
echo "$file"
return 0
fi
hash -r
type -P ${1+"$@"}
}
alias which=_which
fi
====

So, it actually is an alias to the above function _which using
'type -p "$@" || { hash -r; type -P "$@"; }

And openSUSE-10.2 has a /usr/bin/which in util-linux.

And SUSE-7.0 has '/usr/bin/which' in base.rpm and has

alias which='type -p'

in /etc/profile (from aaa_base).


Hah! Thanks for the deep research on it. Yes, I think my (mis)memory
is of the "alias which='type -p'" variety, going back about that far.
I think I started with SuSE 6.2, back around... 2002-ish? Days when
the printed manual in the boxed set had the occasional still-in-German
sentence or paragraph :-)

Cheers,

Michael
--
Michael Fischer
michael@xxxxxxxx
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >