Tag Archives: bash: *: command not found

Mac open terminal error – bash:: command not found

Problem Description:

The MAC system reports an error – bash:: command not found when opening terminal

Problem analysis:

Error reporting does not affect the use of terminal, so it is ignored. But I’m modifying. Bash_After the profile file, in order to make the configuration effective, use the source command, which also reports an error – bash:: command not found

At first, I thought that the source command could not be found, added/bin to the environment variable, or reported this error

The problem is in trouble

In the online search, we found that most of the problems are similar to – bash: nginx: command not found, that is, there is a command between the two:: but the specific command cannot be found. The current error report does not see this command, but a space. It means that the space is also regarded as a command, which means. Bash_A space is written in the profile, which is considered to be executed by the system as a command

Open. Bash_Profile, no space is seen. Copy the file content to the text editor, and no space is seen

For troubleshooting, we intend to comment out all commands, release the command line by line, and then execute the source command to see which line reports an error. Found that the workload was too heavy

Inadvertently opening. Bash with vs Code_Profile, an exception is found, as follows:

Remove this special character and select source again. No more errors will be reported

It can be seen that the system executes this special character as a command, but the command cannot be found, and the command is displayed as a space in the terminal, so the above error is caused

Summary:

1. We should draw inferences from one instance, see the difference between other people’s problems and our own problems, and compare the problems

2. Pay attention to special characters and try to use a rich text editor, such as vs code

 

git bash bash: *: command not found

 

Some functions of GIT bash installed by default are not available, such as zip. When executing zip and unzip commands under git bash, an error will be reported and the command cannot be found. Fortunately, we can install the commands we need. Take the zip command as an example, and the steps are as follows:

1. Open https://sourceforge.net/projects/gnuwin32/files/

2. Find zip and bzip2. Since zip depends on bzip2.dll, Download zip-3.0-bin.zip and bzip2-1.0.5-bin.zip. After decompression, copy zip.exe under bin directory of zip-3.0-bin and bzip2.dll under bin directory of bzip2-1.0.5-bin to & lt; Program folder>\ Git \ usr \ bin, such as mine:

                                                 

3. Then enter zip — help and unzip — help under git bash, which can be used as follows:

  Therefore, similar methods can be used for other commands

Reference: https://ranxing.wordpress.com/2016/12/13/add-zip-into-git-bash-on-windows/