Fork me on GitHub

文章分类 -  Shell

摘要:[TOC] 1.for循环语句 随机生成数字的一种方法 练习 1.for循环在/root下创建10个html文件,其中每个文件需要包含10个随机小写字母和数字,加固定字符串oldchang。名称示例如:apns1yrmk_oldchang.html。 c [root@shell day05] cat 阅读全文
posted @ 2019-08-19 09:52 lcx1997 阅读(125) 评论(0) 推荐(0)
摘要:[TOC] 1.shell是命令解释器,可以解释命令 2.shell脚本是用命令写成的一个可执行的文件 3.shell脚本的用途 4.编译型语言; 5.解释型语言; 6.centos的默认解释器是 7.父shell的环境变量,子shell可以看到 8.子shell的环境变量,父shell不可以看到 阅读全文
posted @ 2019-08-19 09:52 lcx1997 阅读(212) 评论(0) 推荐(0)
摘要:[TOC] 1.if语句 if条件语句,简单来说,其语义类似于汉语中的“如果...那么...”。if语句是Linux运维人员在实际生产过程中使用的最频繁也是最重要的语句。因此,务必重视if条件语句的知识,并牢固掌握。 2.单分支 3. 双分支 4.多分支 练习题—1 c [root@shell in 阅读全文
posted @ 2019-08-19 09:51 lcx1997 阅读(103) 评论(0) 推荐(0)
摘要:[TOC] 友情链接: "ZeroOne01" https://blog.51cto.com/zero01/2046242?tdsourcetag=s_pctim_aiomsg 1.运算符与运算命令 练习取值 2. 使用脚本传参的方式实现整数的加、减、乘、除、取余、幂运算 c x=$1 y=$2 e 阅读全文
posted @ 2019-08-19 09:50 lcx1997 阅读(143) 评论(0) 推荐(0)
摘要:[TOC] 准备机器 shell 10.0.0.21 172.16.1.21 2.解释器类型与执行方式 bash是centos中的默认解释器 c bash ps auxf 查看进程 退出当前shell exit shell 普通变量 [root@shell scripts] name=linux 赋 阅读全文
posted @ 2019-08-18 12:09 lcx1997 阅读(141) 评论(0) 推荐(0)