066_扩展篇_Shell编程(一)_Shell概述 Shell概述 Shell是一个 命令行解释器,他接收应用程序/用户命令, 然后调用操作系统内核。 | +----------------------+ | | +------------------+ | | | | +------------+ | | | | | | +------+ | | | | | | | | 硬件 | | | | | | | | +------+ | | | | | | | Linux内核 | | | | | | +------------+ | | | | | Shell(cd、ls...) | | | | +------------------+ | | | 外层应用程序 | | +----------------------+ Shell还是一个功能强大的变成语言,易编写、易调用、灵活性强。 Linux提供的Shell解释器有 [root@hadoop100 ~]# cat /etc/shells /bin/sh /bin/bash /usr/bin/sh /usr/bin/bash /bin/tcsh /bin/csh 最初的shell版本来源于unix bourne shell, 虽然bourne shell有很灵活的编程操作,但是和用户的交互差。 基于bourne shell发展出了bash,多了很多扩展功能。 红帽系的Linux都是bash,debian的Linux是dash bash和sh的关系 [root@hadoop100 ~]# ll /bin/ | grep bash -rwxr-xr-x. 1 root root 964536 4月 1 2020 bash lrwxrwxrwx. 1 root root 10 7月 23 09:53 bashbug -> bashbug-64 -rwxr-xr-x. 1 root root 6964 4月 1 2020 bashbug-64 lrwxrwxrwx. 1 root root 4 7月 23 09:53 sh -> bash CentOS默认的解释器是bash [root@hadoop100 ~]# echo $SHELL /bin/bash