Disable Bash Builtin Commands

Are you interested in disabling, overriding or replacing one of the bash builtin commands? The command you’re looking for is “enable”, which is weird, because you’d think enable enabled commands. But it does both. “enable -p” will list all the shell builtins you are currently using. “enable -n name” will disable the keyword name. This allows one to use the system versions of time or kill, or whatever else, avoiding the sometimes confusing issue of typing “which commandname” only to have the system tell you one other than the one it’s actually executing. And “enable name” will get you that builtin back. I’m off to change the behavior of kill (essentially to make it behave a little bit like pkill).

Also, better than which “type -a”, this is a bash builtin, so it works principally on magic. But it’ll tell you about builtins and not only the first command in the path by the name you inquire about but all of them.

Posted in Tech. Tags: , , . Leave a Comment »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: