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 @   ShineLe  阅读(232)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
点击右上角即可分享
微信分享提示