[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug, i think? pwd --help and pwd --version don't work
From: |
James Youngman |
Subject: |
Re: bug, i think? pwd --help and pwd --version don't work |
Date: |
Fri, 8 Apr 2005 17:23:36 +0100 |
User-agent: |
Mutt/1.3.28i |
On Fri, Apr 08, 2005 at 12:18:05PM +0530, G. Vamsee Krishna wrote:
> address@hidden ~]$ /usr/local/bin/pwd --help
> Usage: /usr/local/bin/pwd [OPTION]
> Print the full filename of the current working directory.
>
> --help display this help and exit
> --version output version information and exit
>
> Report bugs to <address@hidden>.
>
> address@hidden ~]$ pwd --help
> bash: pwd: --: invalid option
> pwd: usage: pwd [-PL]
>
> address@hidden ~]$ which pwd
> /usr/local/bin/pwd
>
> Strange. Any idea what's going wrong?
Nothing is going wrong. "pwd" is a shell built-in but a binary is
also provided. The binary comes from coreutils and the builtin is
part of bash (or whatever your shell is). See :-
$ which pwd
/bin/pwd
$ echo $0
-bash
$ type pwd
pwd is a shell builtin
$ type which
which is hashed (/usr/bin/which)
"which", being an external program, doesn't know that "pwd" is a shell
builtin. One way of solving this (i.e. making "which" consistent) is
to do this in Bash:-
$ alias which="type -p"
Regards,
James.