Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optional builtin not found when run from namespace #728

Open
McDutchie opened this issue Mar 10, 2024 · 0 comments
Open

optional builtin not found when run from namespace #728

McDutchie opened this issue Mar 10, 2024 · 0 comments
Labels
bug Something is not working

Comments

@McDutchie
Copy link

McDutchie commented Mar 10, 2024

This bug depends on the value of PATH.

Reproducer (replace /path/to/ksh):

PATH=$(getconf PATH) /path/to/ksh -x -c \
    'builtin basename; namespace ns { whence -a basename; basename --version; }; basename --version'

Output (on my system):

+ builtin basename
+ whence -a basename
basename is a shell builtin
basename is /usr/bin/basename
+ basename --version
basename: illegal option -- -
usage: basename string [suffix]
       basename [-a] [-s suffix] string [...]
+ basename --version
  version         basename (ksh 93u+m) 2022-08-30

Expected output:

  version         basename (ksh 93u+m) 2022-08-30
  version         basename (ksh 93u+m) 2022-08-30

Within the namespace, the builtin was not found, and the default external basename was incorrectly run. This is in spite of whence -a correctly finding the built-in.

This bug is also in 93u+ 2012-08-01 and in ksh2020.

@McDutchie McDutchie added the bug Something is not working label Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

1 participant