Problem Description:
When opening Terminal on Mac system, an error -bash:: command not found was reported.
problem analysis:
The error does not affect the use of Terminal, so it is ignored. But after modifying the .bash_profile file, in order to make the configuration effective, using the source command also reported an error -bash:: command not found.
At first I thought it was because the source command could not be found, and I added /bin to the environment variable, but still reported this error.
The problem is in trouble.
Searching on the Internet, I found that most of the problems are similar to -bash:nginx: command not found, that is to say, there is a command between the two ::, but the specific command cannot be found. But the current error report did not see this command, but a space, which means that the space is also regarded as a command, which means that a space is written in .bash_profile, which is considered as a command to be executed by the system.
Open .bash_profile, and no spaces are seen. Copy the contents of the file to a text editor, and no spaces are seen.
In order to troubleshoot, I plan to comment out all the commands, let go of the commands line by line, and then execute the source command to see which line is reporting the error. Found that the workload is too large.
I accidentally opened .bash_profile with VS Code, and found an exception, as follows:
Remove this special character, source again, and no more errors will be reported.
It can be seen that the system executes this special character as a command, but cannot find this command, and this command is displayed as a space in the terminal, which leads to the above error.
Read More:
- MAC Adb Shell Error: -bash: adb: command not found, adb
- -bash: sqlplus: command not found [How to Solve]
- How to Solve Linux Error: -bash: unzip: command not found
- Error in Linux running file: bash: $’\r’: command not found
- Linux Install Bee and Execute Error: bash: bee: command not found
- [Solved] Linux Mongodb Error: # Error: coul-bash: connecting: command not found
- Setting up automatic networking alias for Mac Terminal
- After Centos installation is complete, ifconfig: command not found
- How to Use Apt get Command Under Mac OSX
- arm-eabi-gcc: command not found [How to Solve]
- [Solved] Error detected while processing /root/.vimrc: E492: Not an editor command: Plug ‘scrooloose/nerdtree’
- [Linux] [Ubuntu] Error opening terminal: xterm-256color
- linux Ubuntu Error: No command ‘setenv‘ found
- [Solved] NameError: name ‘reload’ is not defined on ROS melody terminal
- Git commit – M ‘upload submit times error command “husky run” not found.
- [Solved] G++ Error: Command ‘g++‘ not found, but can be installed with:
- Running shell script reports an error: “syntax error near unexpected token solution ‘”
- [Solved] ERROR: Subproject directory not found and gst-plugins-base.wrap file not found
- [Solved] spdlog reports an error After updating Ubuntu 22.04
- [Solved] bash: /etc/vimrc: line 15: syntax error near unexpected token `“autocmd“‘