What is the best way for storing and versioning his aliases/functions/symlinks?
actually I have these lines (exemplary) in my .zshrc
file:
. ${TOOLS_HOME}/cli/.cli_base
. ${TOOLS_HOME}/cli/.cli_functions
. ${TOOLS_HOME}/cli/.cli_symlinks
This works fine so far. My only problem is, that in these .cli_xxx
files I don't have syntax highlighting (For aliases this is ok - but for functions this is very hard).
So I tried this one:
. ${TOOLS_HOME}/cli/cli_base.sh
. ${TOOLS_HOME}/cli/cli_functions.sh
. ${TOOLS_HOME}/cli/cli_symlinks.sh
But (as I red over google) the .
is like source
and when I source my .zshrc
file and execute an alias I sometimes get this error message:
bash:30: maximum nested function level reached
Thats because of the "multi source"??
Somebody have like a "best practice" for storing and versioning aliases/functions/symlinks or do I have to stay with my .cli_xxxx
files??
bash zsh alias rc bash-functions
add a comment |
actually I have these lines (exemplary) in my .zshrc
file:
. ${TOOLS_HOME}/cli/.cli_base
. ${TOOLS_HOME}/cli/.cli_functions
. ${TOOLS_HOME}/cli/.cli_symlinks
This works fine so far. My only problem is, that in these .cli_xxx
files I don't have syntax highlighting (For aliases this is ok - but for functions this is very hard).
So I tried this one:
. ${TOOLS_HOME}/cli/cli_base.sh
. ${TOOLS_HOME}/cli/cli_functions.sh
. ${TOOLS_HOME}/cli/cli_symlinks.sh
But (as I red over google) the .
is like source
and when I source my .zshrc
file and execute an alias I sometimes get this error message:
bash:30: maximum nested function level reached
Thats because of the "multi source"??
Somebody have like a "best practice" for storing and versioning aliases/functions/symlinks or do I have to stay with my .cli_xxxx
files??
bash zsh alias rc bash-functions
2
If the only issue is syntax highlighting, then this should not affect what you call your files. Instead, figure out how you can signal to your editor what syntax highlighting it should use from within the file itself. What editor are you using?
– Kusalananda
Dec 18 '18 at 10:15
actually mostly I use atom - so you say this is the right way what I am doing (with dotfiles)?
– m1well
Dec 18 '18 at 10:16
3
Well, you say that you have something that works. Why break it for the sake of syntax highlighting? Unfortunately I've never used Atom, so I can't really say whether it support modelines, but that's what this feature is usually called. A quick search gave me atom.io/packages/modeline
– Kusalananda
Dec 18 '18 at 10:21
add a comment |
actually I have these lines (exemplary) in my .zshrc
file:
. ${TOOLS_HOME}/cli/.cli_base
. ${TOOLS_HOME}/cli/.cli_functions
. ${TOOLS_HOME}/cli/.cli_symlinks
This works fine so far. My only problem is, that in these .cli_xxx
files I don't have syntax highlighting (For aliases this is ok - but for functions this is very hard).
So I tried this one:
. ${TOOLS_HOME}/cli/cli_base.sh
. ${TOOLS_HOME}/cli/cli_functions.sh
. ${TOOLS_HOME}/cli/cli_symlinks.sh
But (as I red over google) the .
is like source
and when I source my .zshrc
file and execute an alias I sometimes get this error message:
bash:30: maximum nested function level reached
Thats because of the "multi source"??
Somebody have like a "best practice" for storing and versioning aliases/functions/symlinks or do I have to stay with my .cli_xxxx
files??
bash zsh alias rc bash-functions
actually I have these lines (exemplary) in my .zshrc
file:
. ${TOOLS_HOME}/cli/.cli_base
. ${TOOLS_HOME}/cli/.cli_functions
. ${TOOLS_HOME}/cli/.cli_symlinks
This works fine so far. My only problem is, that in these .cli_xxx
files I don't have syntax highlighting (For aliases this is ok - but for functions this is very hard).
So I tried this one:
. ${TOOLS_HOME}/cli/cli_base.sh
. ${TOOLS_HOME}/cli/cli_functions.sh
. ${TOOLS_HOME}/cli/cli_symlinks.sh
But (as I red over google) the .
is like source
and when I source my .zshrc
file and execute an alias I sometimes get this error message:
bash:30: maximum nested function level reached
Thats because of the "multi source"??
Somebody have like a "best practice" for storing and versioning aliases/functions/symlinks or do I have to stay with my .cli_xxxx
files??
bash zsh alias rc bash-functions
bash zsh alias rc bash-functions
asked Dec 18 '18 at 9:57
m1wellm1well
11
11
2
If the only issue is syntax highlighting, then this should not affect what you call your files. Instead, figure out how you can signal to your editor what syntax highlighting it should use from within the file itself. What editor are you using?
– Kusalananda
Dec 18 '18 at 10:15
actually mostly I use atom - so you say this is the right way what I am doing (with dotfiles)?
– m1well
Dec 18 '18 at 10:16
3
Well, you say that you have something that works. Why break it for the sake of syntax highlighting? Unfortunately I've never used Atom, so I can't really say whether it support modelines, but that's what this feature is usually called. A quick search gave me atom.io/packages/modeline
– Kusalananda
Dec 18 '18 at 10:21
add a comment |
2
If the only issue is syntax highlighting, then this should not affect what you call your files. Instead, figure out how you can signal to your editor what syntax highlighting it should use from within the file itself. What editor are you using?
– Kusalananda
Dec 18 '18 at 10:15
actually mostly I use atom - so you say this is the right way what I am doing (with dotfiles)?
– m1well
Dec 18 '18 at 10:16
3
Well, you say that you have something that works. Why break it for the sake of syntax highlighting? Unfortunately I've never used Atom, so I can't really say whether it support modelines, but that's what this feature is usually called. A quick search gave me atom.io/packages/modeline
– Kusalananda
Dec 18 '18 at 10:21
2
2
If the only issue is syntax highlighting, then this should not affect what you call your files. Instead, figure out how you can signal to your editor what syntax highlighting it should use from within the file itself. What editor are you using?
– Kusalananda
Dec 18 '18 at 10:15
If the only issue is syntax highlighting, then this should not affect what you call your files. Instead, figure out how you can signal to your editor what syntax highlighting it should use from within the file itself. What editor are you using?
– Kusalananda
Dec 18 '18 at 10:15
actually mostly I use atom - so you say this is the right way what I am doing (with dotfiles)?
– m1well
Dec 18 '18 at 10:16
actually mostly I use atom - so you say this is the right way what I am doing (with dotfiles)?
– m1well
Dec 18 '18 at 10:16
3
3
Well, you say that you have something that works. Why break it for the sake of syntax highlighting? Unfortunately I've never used Atom, so I can't really say whether it support modelines, but that's what this feature is usually called. A quick search gave me atom.io/packages/modeline
– Kusalananda
Dec 18 '18 at 10:21
Well, you say that you have something that works. Why break it for the sake of syntax highlighting? Unfortunately I've never used Atom, so I can't really say whether it support modelines, but that's what this feature is usually called. A quick search gave me atom.io/packages/modeline
– Kusalananda
Dec 18 '18 at 10:21
add a comment |
1 Answer
1
active
oldest
votes
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/
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489649%2fwhat-is-the-best-way-for-storing-and-versioning-his-aliases-functions-symlinks%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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/
add a comment |
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/
add a comment |
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/
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/
answered 20 mins ago
AdaephonAdaephon
2,65311020
2,65311020
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489649%2fwhat-is-the-best-way-for-storing-and-versioning-his-aliases-functions-symlinks%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
If the only issue is syntax highlighting, then this should not affect what you call your files. Instead, figure out how you can signal to your editor what syntax highlighting it should use from within the file itself. What editor are you using?
– Kusalananda
Dec 18 '18 at 10:15
actually mostly I use atom - so you say this is the right way what I am doing (with dotfiles)?
– m1well
Dec 18 '18 at 10:16
3
Well, you say that you have something that works. Why break it for the sake of syntax highlighting? Unfortunately I've never used Atom, so I can't really say whether it support modelines, but that's what this feature is usually called. A quick search gave me atom.io/packages/modeline
– Kusalananda
Dec 18 '18 at 10:21