I just tried to run this command:

/etc/ssl/acme/acme.sh --log /var/log/p3x/acme/acme.sh.log --home /etc/ssl/acme --force --issue -d patrikx3.tk -w /var/www/acme-challenge

I got this error:

bash: warning: shell level (1000) too high, resetting to 1

What is this error?

  • I had this occur in a Makefile due to how and where (inside an ifneq clause) I was running commands that would use vagrant ssh -c, I had to run it within one statement using &&. Maybe this will help someone. Oct 30, 2018 at 23:47
  • This happened to me while developing a bash script. I accidentally pasted the command to invoke the script into the script itself. This accidentally created an infinite recursion scenario. I removed the command from my script and the the error went away. Oops!
    – Brett K.
    May 29, 2021 at 18:11

1 Answer 1


Shell Level identify the level of sub-shell in a nested shell

Bash man - Shell Level SHLVL

SHLVL - Incremented by one each time a new instance of Bash is started.

  • This is intended to be a count of how deeply your Bash shells are nested.

As you can see here

When bash execute itself the bash shell level is higher in 1

The following recursive call to bash:

$ echo "bash haha" > haha
$ bash haha

Got this message periodically:

bash: warning: shell level (1000) too high, resetting to 1

The meaning of the error above is that bash called itself 1000 times

Another example how $SHLVL variable tracks your shell nesting level:

$ echo $SHLVL
$ bash
$ echo $SHLVL
$ exit
$ echo $SHLVL
  • do you know how to get of rid this error ? i haven't changed on my server still i can see it is in CURL now: bash: warning: shell level (1000) too high, resetting to 1 Jun 10, 2017 at 7:45
  • 2
    ahh i got it, i had the same curl scripts and it was recusive, that's, thanks again, ciao! Jun 10, 2017 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.