Quote:
Originally Posted by hydrurga
Yes, but for a start, Bash isn't the only shell out there.
Whereis and Which simply search specific paths for specific filenames. To search for user-defined shell functions, you would have to start parsing shell-dependent start-up scripts in all the different filesystem locations that those scripts can exist, and parsing all the different forms/syntax that the functions can be written in. It could very quickly become unwieldy and unsustainable.
|
I am not sure to follow your ideas.
Bash is not the only shell out, fine. As I asked in the post I just sent, are declare/typeset present in other shells? Is it present in sh, for example? Yes would be my guess, because there are two names for the same command.
And I really cannot understand your second paragraph. Why do you think we need to search many places? It is just what the shells do for us everytime we type any command (indirectly, since they are defined at login, shell creation or by eventual scripts or commands)!