目录
概述![](https://img-blog.csdnimg.cn/01f64fe06e244b7d976c0f9b1527239e.png)
![](https://img-blog.csdnimg.cn/7de858646a2c4013a16eb2ade07868a7.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5YiY5a6X6Iif,size_20,color_FFFFFF,t_70,g_se,x_16)
shell解析器
(1)Linux提供的Shell解析器有:
[atguigu@hadoop101 ~]$ cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/bin/tcsh
/bin/csh
(2)bash和sh的关系
sh 遵循POSIX规范:“当某行代码出错时,不继续往下解释”。bash 就算出错,也会继续向下执行。
sh 跟bash的区别,实际上是bash有没开启POSIX模式的区别。
简单说,sh是bash的一种特殊的模式,sh就是开启了POSIX标准的bash, /bin/sh 相当于 /bin/bash --posix。
在Linux系统上/bin/sh往往是指向/bin/bash的符号链接
ln -s /bin/bash /bin/sh
(3)Centos默认的解析器是bash
[atguigu@hadoop102 bin]$ echo $SHELL
/bin/bash