1.前言
1.1 linux系统中的shell是什么
在Linux系统中, shell是用户与操作系统进行交互的媒介,bash是目前Linux系统中最常用的shell,我们以bash为例介绍shell的特性,Bash是一个与sh兼容的命令语言解释器,它执行从标准输入或文件中读取的命令。
Bash is an sh-compatible command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh).
1.2 验证环境
[ghost@localhost ~]$ uname -a
Linux localhost.localdomain 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
1.3 当前系统中的shell
[root@localhost ~]# echo $SHELL
/bin/bash
1.4 shell特性
Shell在运行时具有两种属性,即“交互”与“登陆”。
- 按照shell是否与用户进行交互,可以将其分为 交互式(interactive)与 非交互式(non-interactive)
- 按照shell是否被用户登陆,又