Why does the command builtin not circumvent invocation of builtins?

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

 



The dash(1) manpage reads:

command [-p] [-v] [-V] command [arg ...]
       Execute the specified command but ignore shell functions when searching for it. (This is useful when you have a shell function with the same name as a builtin command.)

Because of this, I expected commands like command . or PATH= command true to fail. They don’t.

You can observe this behavior by running:

for cmd in : true . alias bg command cd echo eval exec exit export fc fg getopts hash pwd read readonly printf set shift test [ times trap type ulimit umask unalias unset wait
do
  dash -c "PATH= command $cmd"
  printf '%s: %s\n' $cmd $?
done

Is this an error in the implementation, the documentation, the build, or my interpretation?

The DASH binary I use was obtained using Nix from cache.nixos.org, which builds from source tarballs, specifically http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.12.tar.gz.

Thanks
Anselm Schüler


PS: Why does this mailing list not permit emails that aren’t purely plaintext?





[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux