在开发过程中的所有脚本类的内容均在此类中收录
由于.sh的文件语法相当简单方便,因而就不写条条框框去约束了,直接上干货,f**k goods!
注释:
#looking for the
一个for循环:
(在循环里重复运行某个文件夹里的某一个程序)
#!/bin/sh
for (( i = 1 ; $i <= 100; i++ )) do
/root/Documents/ini/./arrayasbyte
done
if/else语句:
(简单的一个判断内容)
if [[$a_1 == 'yes']&&[$a_2 == 'yes']&&[$the_pid1 == '0']&&[$the_pid2 == '0' ]]
then
echo "ahaha!"
a_10=`ls | grep 'aha' | awk '{print $1}'`;
# ls | 找出含有aha的显示项 | 获取第一个空格之前的值
if [[$the_pid1 == '0']&&[$the_pid2 == '0']]
then
/root/Desktop/./ahaha&
fi
elif [[$a_1 == 'no']||[$a_2 == 'no']]
then
pid_kill=`ps -ef | grep './ahaha' | awk '{print $2}'`;
#注意两边是用的破浪号的那个点`而不是单引号
echo $pid_kill
kill $pid_kill
sleep 1
fi