Re: 'official function declaration format' doesn't work if alias defined
From:
Greg Wooledge
Subject:
Re: 'official function declaration format' doesn't work if alias defined
Date:
Thu, 7 Jan 2016 08:33:27 -0500
User-agent:
Mutt/1.4.2.3i
On Wed, Jan 06, 2016 at 03:49:35PM -0800, Linda Walsh wrote:
> I had an alias referring to printf that I wanted to replace
> with a function.
>
> But then ran into problems with the alias taking precedence over the
> function.
Yup. That's one of the many evils of aliases. They need to be removed
(unalias) before you can redefine them as functions.
That's why I use "exec bash" to reread .bashrc, not just "source .bashrc".
The latter can be confused by previous settings. An "exec bash" always
starts clean.