1、| 左边的输出为右边的输入
2、左边和右边都开启子bash不会改变原值
[root@linux1 sh]# a=10
[root@linux1 sh]# a=22 | echo ok
ok
[root@linux1 sh]# echo $a
10
管道符下子bash 会继承父 bash 的变量
管道符情况下,子bash会继承父bash的变量,其他情况下需要export
[root@linux1 sh]# vi sh03.sh
[root@linux1 sh]# cat sh03.sh
echo $c
echo print
[root@linux1 sh]# export c
[root@linux1 sh]# c=niu
[root@linux1 sh]# ./sh03.sh
niu
print
[root@linux1 sh]# d=11
[root@linux1 sh]# d=22 | echo $d
11
$$ 与 $BASHPID
$$ 接收者ID
$BASHPID 真实ID
let运算符
[root@linux1 sh]# a=1
[root@linux1 sh]# b=2
[root@linux1 sh]# let c=$a+$b
[root@linux1 sh]# let d=$((a+b))
[root@linux1 sh]# echo $c
3
[root@linux1 sh]# echo $d
3
[root@linux1 sh]# ((a++))
[root@linux1 sh]# echo $a
2
test
[root@linux1 sh]# test 3 -gt 1
[root@linux1 sh]# echo $?
0
[]
[root@linux1 sh]# [ 3 -gt 1 ]
[root@linux1 sh]# echo $?
0