Linux/:各种错误

1、sudo: a terminal is required to read the password; either use the -S option to read from standard in or configure an askpass helper

sudo: a terminal is required to read the password; either use..... 问题解决方法

2、xxx not found、未找到命令

cc:yum -y install gcc-c++ 

cd:cd与路径间需要有空格

make:sudo yum install make

rz:yum install lrzsz

vim:yum -y install vim

wget:yum -y install wget

tree:sudo yum install tree

telnet:yum -y install telnet Telnet:未找到命令_笔记大全_设计学院

3、由于shell的if语法错误导致的错误:

  • 错误的替换/bad subsitution

  • 未预期的符号 `then' 附近有语法错误

  • 未预期的符号 `fi' 附近有语法错误

正确的if写法:

if [ $`whoami`="miduser" ];then
    exit
    echo "exit"
fi

需要注意的地方:

  • if、中括号、内部表达式之间必须要有有空格
  • then之后必须有执行语句,不能写空if
  • 判断字符串相等时,要用=而非==。

posted @ 2023-08-14 15:33  ShineLe  阅读(261)  评论(0)    收藏  举报