shell dash_什么是Dash / Shell / sh以及如何使用?

shell dash

shell dash

Linux provides a lot of different type of shells. There are shells like bash, ksh, csh. But what non of them exist in a Linux or Unix system. The default shell for Linux and Unix systems is sh . This shell is called also dash because of its maintainers those works for Debian. We will call this as sh from now.

Linux提供了许多不同类型的Shell。 有像bash,ksh,csh之类的shell。 但是在Linux或Unix系统中不存在它们。 Linux和Unix系统的默认外壳是sh 。 这个外壳也被称为破折号,因为它的维护者适用于Debian。 从现在开始,我们将其称为sh

Sh is by default installed and exist most of the Linux distributions and Unix. Sh is compact shell which have limited capabilities compared to bash, ksh, csh .

默认情况下,Sh已安装,并且存在于大多数Linux发行版和Unix中。 Sh是紧凑的外壳,与bash,ksh和csh相比,功能有限。

Sh have less library dependency and needs less memory. Embedded systems like modem, router, wireless uses sh because of its simplicity. It is fast but have limited capabilities like not having shell programming.

Sh具有较少的库依赖性,并且需要较少的内存。 诸如调制解调器,路由器,无线之类的嵌入式系统由于其简单性而使用sh。 它速度很快,但是功能有限,例如没有外壳编程。

运行Sh (Run Sh)

As said before sh is installed by default but most of the Linux distributions use bash as default shell. Current working shell can be changed to the sh like below just calling /bin/sh shell executable.

如前所述,默认情况下会安装sh,但是大多数Linux发行版都将bash用作默认外壳。 只需调用/bin/sh shell可执行文件,就可以将当前工作的shell更改为如下所示的/bin/sh

$ /bin/sh
Run Sh
Run Sh
运行Sh

In the last line of the screen shot it can be seen that /bin/sh is the default shell and assigned to _ shell variable.

在屏幕快照的最后一行中,可以看到/bin/sh是默认的shell,并分配给_ shell变量。

Sh出口 (Exit Sh)

As running the sh executable starts new shell we want to exit this shell. To exit current sh shell just issue exit command like below.

当运行sh可执行文件启动新的Shell时,我们要退出此Shell。 要退出当前的sh shell,只需发出如下的exit命令。

$ exit
Exit Sh
Exit Sh
Sh出口
LEARN MORE  Bash Printf Function Tutorial with Examples
了解更多Bash Printf函数示例教程

翻译自: https://www.poftut.com/what-is-dash-shell-sh-and-how-to-use-it/

shell dash

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值