Reputation: 79319
Take a look at this example:
[boda]$ alias aaa='echo aaa'
[boda]$ function aaa () { echo bbb }
[boda]$ function aaa () { echo bbb; }
[boda]$ aaa
aaa
As you can see I've both alias aaa
and function aaa
. However when I execute aaa
the alias runs.
How do I run the function instead?
Upvotes: 5
Views: 1245
Reputation: 7952
The man page for alias
reveals that there is an unalias
command.
unalias aaa
If you run this, even after both the alias
and the function
have been defined, calling aaa
again should run the function. This does, however, destroy the alias. If that's undesirable, then anubhava's answer (or Keith Thompson's suggestion to not define them with the same name) is best.
Upvotes: 0
Reputation: 785098
when I execute aaa the alias runs.
You can run it as:
\aaa
This will call function.
Upvotes: 8