I suspect, that the issue is completely unrelated to the name of the files would also happen if you sourced .zshrc
in the original state.
Cause of the error
This error usually happens when you call a function from within itself, leading to a recursion. This may inadvertently happen, when you give functions the same name as an external command or builtin that is used within that function. For example:
echo () {
echo "Out: " $@
}
The command echo
will work just fine, before you define this function, but after the definition it will fail with this error:
% echo foobar
echo:1: maximum nested function level reached; increase FUNCNEST?
(The difference in the message text is probably due to the zsh versions used, which in my case is 5.6.2)
It can also happen through multiple functions calling each other:
foo () {
echo $@
}
echo () {
something_else
foo $@
}
The error message will show the name of the function that cannot be called anymore due to the nesting limit being reached and the line of the function where this call happens. So in the above case either:
% echo foobar
echo:1: maximum nested function level reached; increase FUNCNEST?
or
% echo foobar
foo:2: maximum nested function level reached; increase FUNCNEST?
In the case of the question it seems that a function with the name bash
is called in line 30 of some function.
Fixing it
Unless the recursion is intentional, this can be prevented by telling zsh
which non-function command you want to use.
If you want the built-in command, just prepend builtin
:
echo ()
{
builtin echo "Out: " $@
}
If you want an external command, either prepend command
:
echo ()
{
command echo "Out: " $@
}
or use its full path
echo ()
{
/bin/echo "Out: " $@
}
If you are not sure where you are using bash
in your zsh
configuration, you can use grep
to search ${TOOLS_HOME}/cli/
recursively:
grep -r bash ${TOOLS_HOME}/cli/