Shell脚本(一)入门
2024-10-09 02:01:39
开始学习Shell脚本。
#!/bin/bash if [ $UID -ne ]; then
echo "you are not root"
else
echo "you are root"
fi var="hello world"
echo $var
echo ${var}
echo "var is $var"
echo 'var is $var'
echo "length of var is ${#var}"
注意点:
1. var="hello world",等号两边不要有空格。
2. 变量替换在单引号中无效。
参考资料:
《Linux Shell 脚本攻略》
最新文章
- 常用js代码集
- 5.首次登陆与在线求助man page
- [转]Amazon DynamoDB – a Fast and Scalable NoSQL Database Service Designed for Internet Scale Applications
- C语音常用库和函数
- Python访问剪切板
- git常用命令表
- 【Go语言】I/O专题
- Linux内核知识
- 小技巧:SystemTray中进行操作提示
- nodejs child process
- Error message “Assembly must be registered in isolation” when registering Plugins in Microsoft Dynamics CRM 2011 2013 解决办法
- Jasper_sheetName_defined by parameter or hard coding or filed name
- QT IP输入框正则表达式(使用QLineEdit的setValidator函数)
- SQL Server 有关EXCEPT和INTERSECT使用
- Core Animation中的基础动画
- JavaScript获取html元素的实际宽度和高度
- Python logging 模块和使用经验
- CSS后代选择器“空格”和“>;”的使用辨析
- 基于Cloudera Search设计数据灾备方案
- MySQL的自动提交模式