Unexpected -bash command not found error when starting new mac terminal window
Troubleshooting syntax errors in the shell scripts is the fastest way to remove this.


Backup and rename all . files for your shell - .bashrc and .bash_profile


Verify the issue is resolved. Build up your files line by line or by doing a split half search (add half the things the file does at a time - adding / removing half) if your files are very long or involved.

You're in good company on this one:


-bash: 1: command not found - Immediately on loading Terminal
terminal -bash: command not found
Terminal command not found
Unknown error message in Terminal


It doesn't really matter that nothing changes in the file if it sources other files or the global environment has changed - setting aside your files is the fastest way to get to a stable bash (or whatever shell you prefer) and then build things up slowly.

Once you're sure it's not the startup files, then look at the application running. If it's terminal.app - it can be set to run a command or script when it starts - you can remove those preferences or perhaps make a new user account and verify it's either a system wide issue or just restricted to your user account and user preferences.