Tag Archives: bash

[Solved] SHELL Run Error: “-BASH: ./TEST.SH: /BIN/BASH^M: BAD INTERPRETER: NO SUCH FILE OR DIRECTORY”

Solve the error reported by the running shell

-bash: ./test.sh: /bin/bash^M: bad interpreter: No such file or directory

What is the reason? There is reason to suspect that it is a file format problem? We use VIM test.sh to enter the test.sh file, and then execute it in the bottom mode: set FF to check. The result shows that fileformat = DOS. Look, it is indeed a file format problem. How to solve it?

Solution:

[root@admin .sh]# vim test.sh

Execute: e + + FF = UNIX%, then delete the ^ m symbol
save and exit

or:

[root@admin .sh]# sed -i "s/\r//" test.sh

Or:

[root@admin .sh]# dos2unix test.sh

Or: VIM test.sh open the file, execute: set FF = UNIX, set the file to UNIX, then execute: WQ, and save it in UNIX format.

[Solved] CMake Error at CMakeLists.txt:92 (add_subdirectory)

When compiling GitHub project, you may encounter the following errors:

CMake Error at CMakeLists.txt:92 (add_subdirectory):
 The source directory
xxxxx

CMake Error at src/Runtime/CMakeLists.txt:56 (pybind11_add_module):
 Unknown CMake command "pybind11_add_module".

This is generally a lack of third-party dependencies. You can try the following command:

git submodule init && git submodule update

Reference:
https://stackoverflow.com/questions/59291154/cmake-error-at-cmakelists-txt994-add-subdirectory

Message log output sbridge: Handling MCE memory error error

/The var/log/message system log is always output, causing the/partition disk to be full

sbridge: HANDLING MCE MEMORY ERROR
kernel: CPU 8: Machine Check Exception: o Bank 5: cc00020000010090
kernel: TSC O ADDR 2068ce8080 MISC 40109086 PROCESSOR O: 206d6 TIME 1634693540 SOCKET 1 APIC 20

resolvent:

 rmmod -v sb_edac

[Solved] Error: no “print“ mailcap rules found for type “text/plain“

Blog background

The author has always wanted to understand how to use the Print command under Linux?

Direct Print hello. TXT will report an error

Error: no "print" mailcap rules found for type "text/plain"

Specific operation

ubuntu@139:~/temp $ cat /etc/mailcap | egrep print
application/x-troff-man; /usr/bin/nroff -mandoc -Tutf8; copiousoutput; print=/usr/bin/nroff -mandoc -Tutf8 | print text/plain:-
text/troff; /usr/bin/nroff -mandoc -Tutf8; copiousoutput; print=/usr/bin/nroff -mandoc -Tutf8 | print text/plain:-
text/plain; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; print=cat %s; needsterminal
application/x-tar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
application/x-gtar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
application/x-ustar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
ubuntu@139:~/temp $ ls
hello  hi.txt
ubuntu@139:~/temp $ cat hi.txt 
hello
ubuntu@139:~/temp $ print hi.txt 
hello

This is the situation after I edit the mailcap file. Pay attention to this line

text/plain; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; print=cat %s; needsterminal

That is, just add a print command rule after text/plain, which is so simple.

The Linux terminal appears bash: setup.bash : no such file or directory, and. Bashrc file

Earlier in the Linux open a terminal, he always appear bash:/opt/ros/indig/setup. Bash: No to the file or directory. This problem is related to the bash that needs to be loaded every time the terminal is opened.

/etc/bashrc: This file sets up environment information for each user of the system and is executed when the user first logs in and collects shell Settings from the configuration file in the /etc/profile.d directory. This file is read when the bash shell is opened.
~/.bash_profile: Each user can use this file to enter specific shell information for his or her own use, and this file is executed only once when the user logs in! By default, it sets some environment variables and executes the user’s.bashrc file.
~/.bashrc: This file contains bash information specific to your bash shell, which is read when you log in and every time you open a new shell.
/.bash_logout: This file is executed every time you exit the system (exit the bash shell)
I turn to open the file, the last in ~ /. Bashrc found the last line of this file: the source/opt/ros/indig/setup. Bash the bash file does not exist in the file system, so I deleted it. After that, it works fine when you start the terminal again.
P.S. We can get through

echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc

Command to add a path to the.bashrc file.

Then through

source ~/.bashrc

Order to put it into effect.