Why does the shell script always break down when running for statement Back

  • When running for statement in Ubuntu, you'll always find the command line will print out something as follow:
Syntax error: Bad for loop variable
  • The reason is that Ubuntu has used dash shell instead of bash shell since Ubuntu 6.10, because it's lighter.
  • Solution: just set back to bash:
sudo dpkg-reconfigure dash
# choose no
Empty Comments
Sign in GitHub

As the plugin is integrated with a code management system like GitLab or GitHub, you may have to auth with your account before leaving comments around this article.

Notice: This plugin has used Cookie to store your token with an expiration.