好吧,我们还是看书吧….
echo Hello world ! 等价于 echo ‘Hello world !’ 但是不等价于echo “Hello world !”(!放在双引号里边的时候需要转义\)
简单的判断例子
1 2 3 4 5 6 |
#!/bin/bash if [ $UID ne 0 ];then echo Non root user.Please run as root. else echo "Root user" fi |
….
休息一会继续
继续
1 2 3 4 5 6 7 |
#!/bin/bash start=$(data +%s) commands; statements; end=$(data +%s) differenc=$((end - start)) echo Time taken to execute commands is $difference seconds. |
时间:2012-12-10 21:07:27
Latest posts by Zhiming Zhang (see all)
- aws eks node 自动化扩展工具 Karpenter - 8月 10, 2022
- ReplicationController and ReplicaSet in Kubernetes - 12月 20, 2021
- public key fingerprint - 5月 27, 2021