Re: pwd; docs, builtins and exec
On Thu, 20 Aug 1998, Philip Hands 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. It also suggests the
> > options -PL which, although accepted, seem to cause no change in the
> > output.
> >
> > 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?)
>
> Um, that's down to the ``exec'' which replaces the shell with pwd, which then
> exits and logs you out --- try
>
> exec ls
>
> and it too exits.
Understood.
>
> BTW my ash behaves exactly the same as bash. Do you have a path which fails
No it doesn't.
> to include pwd when running under ash ?
>
> Oh, just for reference:
>
> bash-2.01$ pwd --version
> bash: pwd: illegal option: --
> pwd: usage: pwd [-PL]
This is the bash builtin. Note that it rejects the option as illegal.
> bash-2.01$ /bin/pwd --version
> pwd (GNU sh-utils) 1.16
> bash-2.01$ ash
> $ pwd --version
> /mirror/tmp/gnome
This is the ash buitin. Note that it accepts the option, but ignores it
and prints the path instead.
> $ /bin/pwd --version
> pwd (GNU sh-utils) 1.16
> $
In either case the /bin/pwd --version works fine because it is the GNU
version.
I suppose that since GNU behavior is not declared for shells, and posix
doesn't define the actions of non-posix options, that the diversity in
behavior is acceptable under these standards. It just doesn't seem
valuable to maintain such a confusing situation.
Is there a way to disable the builtins, so that the actual commands are
executed instead? (if, else, and fi are all buitins too aren't they ;-(
Oh well ;-)
Thanks,
Dwarf
--
_-_-_-_-_- Author of "The Debian Linux User's Guide" _-_-_-_-_-_-
aka Dale Scheetz Phone: 1 (850) 656-9769
Flexible Software 11000 McCrackin Road
e-mail: dwarf@polaris.net Tallahassee, FL 32308
_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-
Reply to: