Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to configure the command which to show alias?

0 views
Skip to first unread message

peng...@gmail.com

unread,
Nov 17, 2009, 9:50:44 PM11/17/09
to
I have see 'which' can show alias on some other machines. But 'which'
on my current machine does not work in this way. Can somebody let me
know if it is possible to configure 'which' to show alias?

Seebs

unread,
Nov 17, 2009, 10:50:41 PM11/17/09
to

No. Look to see what your specific shell has for such things. On many
systems, "which" is an external command, which necessarily lacks information
about your shell's internal state. I think every shell with aliasing has
a way to show the aliases.

-s
--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Lao Ming

unread,
Nov 18, 2009, 12:58:05 AM11/18/09
to
On Nov 17, 7:50 pm, Seebs <usenet-nos...@seebs.net> wrote:

> On 2009-11-18, PengYu...@gmail.com <pengyu...@gmail.com> wrote:
>
> > I have see 'which' can show alias on some other machines. But 'which'
> > on my current machine does not work in this way. Can somebody let me
> > know if it is possible to configure 'which' to show alias?
>
> No.  Look to see what your specific shell has for such things.  On many
> systems, "which" is an external command, which necessarily lacks information
> about your shell's internal state.  I think every shell with aliasing has
> a way to show the aliases.
>
> -s
> --
> Copyright 2009, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

On Solaris, do:

file `which which`

Mine says it's a csh script.


On OSX, do:

file $(which which)

Mine says it's a Mach-O universal binary.

In any case, on most systems, just enter:

alias
-or-
alias yourAlias

Chris F.A. Johnson

unread,
Nov 18, 2009, 1:00:33 AM11/18/09
to

Use 'type', not 'which'.

--
Chris F.A. Johnson, author <http://shell.cfajohnson,com/>
===================================================================
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)

Glenn Jackman

unread,
Nov 20, 2009, 7:32:21 AM11/20/09
to

With bash: type -a some_command

--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous

0 new messages