摘要: 阅读全文
posted @ 2020-05-06 20:23 鸿杨杨 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 主的虚拟机 #!/bin/bashservice iptables stopsetenforce 0yum -y install mysql mysql-serversed -i '/log-bin=mysql-bin/d' /etc/my.cnfsed -i '/server-id=1/d' /e 阅读全文
posted @ 2020-05-06 20:21 鸿杨杨 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashsui=$(expr $RANDOM % 100)ci=0echo "商品的价格"while truedo read -ep "请输入你猜测的价格" cai let ci++ if [ $cai -eq $sui ] then echo "恭喜你猜对了实际价格$sui" ech 阅读全文
posted @ 2020-05-06 20:19 鸿杨杨 阅读(249) 评论(0) 推荐(0) 编辑
摘要: #!/bin/basha='stu'i=1while [ $i -le 10 ]do useradd ${a}$i echo "123" | passwd --stdin ${a}$i &> /dev/null let i++done 阅读全文
posted @ 2020-05-06 20:18 鸿杨杨 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashecho "1.剪刀 2.石头 3.布"game=(剪刀 石头 布)num=$[RANDOM%3]sui=${game[$num]}echo $suiecho $numwhile truedo read -ep "是否开始游戏,请输入yes或no" aa if [ aa == 阅读全文
posted @ 2020-05-06 20:17 鸿杨杨 阅读(165) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashwhile truedo echo "1.系统版本" echo "2.系统负载" echo "3.系统登录用户" echo "4.内存使用率" echo "5.硬盘使用率" echo "6.日期时间" echo "7.退出" echo "" read -ep "请输入想执行的命 阅读全文
posted @ 2020-05-06 20:14 鸿杨杨 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #!/bin/basha=0sum=0while truedo let a++ if [ $a -le 100 ] && [ `expr $a % 2` -eq 0 ] then if [ $a -eq 100 ] then break fi else let sum=sum+a fidoneech 阅读全文
posted @ 2020-05-06 20:11 鸿杨杨 阅读(211) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashecho "检测文件类型"read -ep "请输入要检测的路径" fileif [ ! -e $file ]then echo "文件不存在,请检查输入是否正确"elif [ -L $file ]then echo "链接文件"elif [ -d $file ]then ec 阅读全文
posted @ 2020-05-06 20:10 鸿杨杨 阅读(274) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashecho "输入分数判断优秀,及格,不及格"read -ep "请输入分数" fsif [ $fs -ge 85 ] && [ $fs -le 100 ]then echo "$fs 分,优秀"elif [ $fs -ge 70 ] && [ $fs -le 84 ]then 阅读全文
posted @ 2020-05-06 20:09 鸿杨杨 阅读(248) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashecho "输入服务测试是否开启"read -ep "请输入服务" fw$fw status &> /dev/nullif [ $? -eq 0 ]then echo "$fw 服务开启"else echo "$fw 服务不可用"fi 阅读全文
posted @ 2020-05-06 20:08 鸿杨杨 阅读(410) 评论(0) 推荐(0) 编辑