Re: [FC3] where is which??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 29 Nov 2004, Aleksandar Milivojevic wrote:

> akonstam@xxxxxxxxxxx wrote:
> > The type command huh! you learn something new everyday. As long as you
> > are learning you can't die. At least that is my theory.
> >
> > But the which command works on my FC3 system.

might as well toss in my $0.02 here.  on most systems, "which" is an
external executable, while "type" is a shell builtin:

  $ type type
  $ type which

normally, this means that "which" can only tell you about other
external executables, while "type" can tell you about aliases, shell
functions and shell builtins as well, which makes it significantly
more useful.

in effect, because "type" lives inside the shell, it can tell you
about other things inside the shell, while "which" is restricted to
telling you about just the externals.  if that's all you care about,
fine.

in some cases, "which" is actually aliased to try to get back inside
the shell, as in:

$ alias which
alias which='alias | /usr/bin/which --tty-only ... etc etc.

what this is doing is (kind of) cheating to reach back inside the
shell to get at the current aliases.  which works, but it clearly
can't help you with builtins or shell functions:

  $ which type	 	# won't find it

and that's pretty much the story.

rday



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux