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
- 判断字符串相等时,要用=而非==。
分类:
Linux与Shell
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性