bashplotlib icon indicating copy to clipboard operation
bashplotlib copied to clipboard

Rename `hist` command to something less likely to be a shell builtin

Open kqr opened this issue 6 years ago • 2 comments

My shell (ksh93) informs me that

$ type -a hist
hist is a shell builtin
hist is /Library/Frameworks/Python.framework/Versions/3.6/bin/hist
hist is an undefined function

in other words, if I try to run hist I will get the shell builtin first. I can circumvent that by using the env program, but this is not obvious right away.

kqr avatar Nov 19 '19 11:11 kqr

Just an observer here, but...

What is likely to be builtin really depends on what shell whoever is using, and there are enough shells there so changing API just because one of them does not seem to be good enough reason.

POSIX sh builtins (hist is not one of them, according to posix manpages on Fedora 30) would get exception as most of them is almost guarranteed to be in many shells, but then again, POSIX itself defines command so you can work around your problem by calling

command hist

(for interactive usage, you could do something like, alias bpl_hist='command hist' could be better.

That said, if bashplotlib would want to avoid conflicts altogether, renaming all commands to eg. bashplotlib-hist, etc. could be one solution but it seems like overkill though... :)

AloisMahdal avatar Nov 29 '19 17:11 AloisMahdal

Well, it's not like ksh93 is one of the new shells with a small user base. It's also not like it changes a lot -- it's been there since at least 1993.

I respect whatever decision you make, I'm just pointing out that the current failure mode in one of the older, bigger shells is a terrible user experience. If it's not fixed, it should at the very least be documented.

kqr avatar Dec 02 '19 05:12 kqr