shell实现数字打印从100到200的数
网络编程
#!/bin/bash
#name: print number from 100 to 200
for i in $(seq 100 200)
do
echo $i
done
五个常用的Linux监控脚本代码
1、查看主机网卡流量#!/bin/bash#network#Mike.Xuwhile:;dotime='date+%m"-"%d""%k":"%M'day='date+%m"-"%d'rx_before='ifconfigeth0|sed-n"8"p|awk'{print$2}'|cut-c7-'tx_before='ifconfigeth0|sed-n"8"p
比较两个字符串是否相等的shell代码
比较两个字符串是否相等的办法是:if["$test"x="test"x];then这里的关键有几点:1使用单个等号2注意到等号两边各有一个空格:这是unixshell的要求3注意到"$te
shell脚本运行5秒后自动退出的代码
#!/bin/bash#nameshow_status.sh#echo$$/var/run/show_status.log#sleep5&&kill`cat/var/run/show_status.log`startcodeecho"helloworld"#endcode
编辑:一起学习网
标签:等号,注意到,代码,字符串,脚本