云计算学习路线教程代码笔记:Shell编程
发表于:2024-10-11 作者:千家信息网编辑
千家信息网最后更新 2024年10月11日,这篇文章是云计算学习路线教程代码笔记关于Shell编程for循环结构的内容。for i in {取值范围}do循环体done求取1-100数字的和、找出1-100中能被2整除的数字、找出1-100中的
千家信息网最后更新 2024年10月11日云计算学习路线教程代码笔记:Shell编程
这篇文章是云计算学习路线教程代码笔记关于Shell编程for循环结构的内容。
for i in {取值范围}
do
循环体
done
求取1-100数字的和、找出1-100中能被2整除的数字、找出1-100中的素数、找出1-100种能被3整除的数字
#!/usr/bin/env bash
#
Author: bavdu
Email: bavduer@163.com
Github: https://github.com/bavdu
Date: 2019//
sum=0
for i in {1..100}
do
let total=$sum+$i #或者写成let total=i++
done
printf "$total\n"
测试生产环境中的主机存活性
#!/usr/bin/env bash
#
Author: bavdu
Email: bavduer@163.com
Github: https://github.com/bavdu
Date: 2019//
ip_alive.txt
ip_down.txt
export segment="192.168.161"
for i in {2..254}
do
{
ping -c1 $segment.$i &>/dev/null
if [ $? -eq 0 ];then
printf "alive: $segment.$i\n" >>ip_alive.txt
else
printf "down: $segment.$i\n" >>ip_down.txt
fi
}&
done
wait
printf "$(date +%Y-%m-%d_%k:%M:%S) -exec filename:$0\n"
数字
循环
代码
教程
笔记
路线
学习
编程
主机
内容
循环体
环境
篇文章
素数
结构
范围
测试
生产
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
上海好的软件开发特点
计算机网络技术的发展标志性技术
网络安全实时
音乐软件开发被团队背叛
access数据库总被锁死
数据库报错40001
文件管理云服务器
软件开发 国民经济行业
网络安全大专毕业论文开题
家长对网络安全教育心得体会
武汉有哪个学校学软件开发
软件开发需要很大内存吗
网络安全工作计划乡镇
旌德先进软件开发服务解决方案
一个数据库由什么组成
教育软件开发微课
ajax查询数据库数据库
吉大网格计算与网络安全
软件开发考研工资一般多少
网络技术国家战略
旅游数据库需求
学校网络安全工作现状
服务器系统崩了怎么处理
北方网络安全海报
图书借阅系统实验报告数据库
服务器管理第三方
数据库连接池瓶颈
计算机网络技术基础微课视频
中文企业级数据库软件
航信a3财务软件无法连接数据库