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

Re: pwd; docs, builtins and exec



Dale Scheetz writes:
> Reading the info page on pwd says that the command responds to --help and
> --version options. When executed on a Debian system in a bash shell, the
> builtin command refuses to accept either option. It also suggests the
> options -PL which, although accepted, seem to cause no change in the
> output.

>From the bash man page:

       pwd [-LP]
              Print the absolute file name of the current working
              directory.  The file name printed contains no  sym?­
              bolic  links if the -P option is supplied or the -o
              physical option  to  the  set  builtin  command  is
              enabled.   If the -L option is used, symbolic links
              are followed.  The return status  is  0  unless  an
              error  occurs while reading the name of the current
              directory.

Thus bash does not claim to accept 'pwd --help'.

> If I 'exec pwd --version' it prints:
> pwd (GNU sh-utils) 1.16
> and promptly logs me out. (I assume from the "exit" it does?)

Well, sure.  Your shell is gone!

> First, there is either a bug in the manpage (although it does suggest
> that shell programs provide this function in a builtin) for suggesting
> that the -- options work, or there is a bug in bash for not accepting the
> options.

The options work fine with /bin/pwd.

> Anyone have any idea of the proper point of view here?

I can't quite see calling it a bug, but it does seem inelegant that a GNU
utility would contradict a GNU built-in.  What does POSIX require?
-- 
John Hasler
john@dhh.gt.org (John Hasler)
Dancing Horse Hill
Elmwood, WI


Reply to: