每当我打开两个命令提示符时,执行命令后总会弹出此脚本。只是为了澄清命令执行和输出是否正确,但在下一个命令提示符之前的输出之后我得到了这个。有人知道这是什么以及如何解决它吗
注意:如果我打开了两个以上的命令提示符,它仍然只会出现在第二个命令提示符中,而不会出现在第三个或第四个命令提示符中,只会出现在第二个命令提示符中
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: syntax error
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: K
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ?
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: ^[
(standard_in) 1: illegal character: H
File "<stdin>", line 1
print / 2
^
SyntaxError: invalid syntax
答案1
我已经通过将 .bashrc 文件中的 PS1 从
PS1='${debian_chroot:+($debian_chroot)}\[\e[1;4;32m\]\u@\h\[\e[00m\]\n\[\e[0;34m\]Date:\d | Time:\t\[\e[00m\]\n\[\e[2;33m\]Shell:\s | Version:\V\[\e[00m\]\n\[\e[4;1;31m\]CPU Usage $(echo print `top -n 1 | tr -s " " | cut -d$" " -f10 | tail -n +8 | head -n -1 | paste -sd+ | bc`/ `nproc` | python)% | Free Memory $(awk "/MemFree/{print \$2}" /proc/meminfo)\[\e[00m\]\n\[\e[4;35m\]Command History:\!\[\e[00m\] | \[\e[4;37m\]Command Number:\#\[\e[00m\]\n\[\e[1;33m\]{Directory:\w}\[\e[00m\]\n\[\e[1;2;32m\]I am ready for your commands master \$}-\[\e[00m\]\[\e[36m\]'
到
PS1='${debian_chroot:+($debian_chroot)}\[\e[1;4;32m\]\u@\h\[\e[00m\]\n\[\e[0;34m\]Date:\d | Time:\t\[\e[00m\]\n\[\e[2;33m\]Shell:\s | Version:\V\[\e[00m\]\n\[\e[4;1;31m\]CPU Usage $(echo print `top -n 1 | tr -s " " | cut -d$" " -f10 | tail -n +8 | head -n -1 | paste -sd+ | bc`/ `nproc` | python)% | Free Memory $(awk "/MemFree/{print \$2}" /proc/meminfo)\[\e[00m\]\n\[\e[4;35m\]Command History:\!\[\e[00m\] | \[\e[4;37m\]Command Number:\#\[\e[00m\]\n\[\e[1;33m\]{Directory:\w}\[\e[00m\]\n\[\e[1;2;32m\]I am ready for your commands master \$}-\[\e[00m\]\[\e[36m\]'
不过如果有人能告诉我第一台 PS1 出了什么问题,我将不胜感激