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

Re: pwd; docs, builtins and exec



Previously Dale Scheetz wrote:
> 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.

The info page is from fileutils, the builtin is from bash. So there are 
bound to be differences.. nobody claimed that shell builtins should comply
to fileutils options.

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

Do /bin/pwd --version. If you exec a command it will replace the shell,
so when it exits the shell is no longer there and you'll be logged out.

> Interestingly enough, if you try this with ash, the command works as
> normal pwd even when you pass it the options --version, or --help. That is
> these options are totally ignored in ash.

Which only suggest ash does not use builtins for the commands and relies
on the fileutils version of these commands.

> These seem to be GNU issues more than POSIX, although there are answers
> from either camp I suppose.

Does POSIX say pwd & friends should accept a --version option? Afaik 
POSIX doesn't have long options, so this does not hold.

Wichert.

-- 
==============================================================================
This combination of bytes forms a message written to you by Wichert Akkerman.
E-Mail: wakkerma@wi.LeidenUniv.nl
WWW: http://www.wi.leidenuniv.nl/~wichert/

Attachment: pgp4vlDVJyVTL.pgp
Description: PGP signature


Reply to: