shell
LiaoBin0608
这个作者很懒,什么都没留下…
展开
-
shell学习笔记2-逻辑控制
1、if结构 if [ condition ] ;then …fi; if [ condition ]; then …else…fi; if [ condition ];then …elif [ conditon ]; then …fi; 简单的逻辑判断可以用&&||代替 # if 基本用法 [root@VM_0_2_centos home]# if [ 2 -eq 2 ];then echo "相等";fi 相等 # if ..else 用法 [root@VM_0_2_centos h原创 2020-06-12 11:45:09 · 133 阅读 · 0 评论 -
shell学习笔记1-基本语法
1、变量定义 查看本机支持的shell [root@VM_0_2_centos /]# cat /etc/shells /bin/sh /bin/bash /sbin/nologin /usr/bin/sh /usr/bin/bash /usr/sbin/nologin /bin/tcsh /bin/csh 变量的定义 a=1 b=hello c="hello world" d='"hello world" 你好' e=`ls` =左右不能有空格 如果内容内有空格,需要用单引号或者双引号 单引号和双原创 2020-06-12 10:17:21 · 245 阅读 · 0 评论