Korn Shell(ksh)和Bash之间的区别

Bash is very popular Linux and Unix shell used system administrators. Even most of the users do not know that they are using bash shell because of it is provided by default in the operating system. There are different shell types supported by Linux, Unix and BSD. Korn shell is another but less popular shell. In this post we will compare bashand kshand try to show differences and similarities between them.

Bash是非常流行Linux和Unix Shell使用的系统管理员。 甚至大多数用户都不知道他们在使用bash shell,因为操作系统默认情况下提供了它。 Linux,Unix和BSD支持不同的外壳类型。 Korn外壳是另一个但不太流行的外壳。 在这篇文章中,我们将比较bashksh并尝试显示它们之间的差异和相似之处。

Bash和Korn Shell Binaries (Bash and Korn Shell Binaries)

Bash shell binary or interpreter is located at the /bin/bash . While bash interpreter binary size is 1.1 MB

Bash shell二进制或解释器位于/bin/bash 。 虽然bash解释器的二进制大小为1.1 MB

Ksh shell binary or interpreter is located as /bin/ksh. Korn shell binary is 1.6 MB.

Ksh Shell二进制或解释器位于/bin/ksh 。 Korn Shell二进制文件为1.6 MB。

Bash and Kornshell Binaries
Bash and Kornshell Binaries
Bash和Kornshell二进制文件

脚本扩展(Script Extension)

As issuing same commands again and again not a practical way we generally prefer scripts. Both bash and ksh have scripting capabilities. While extension is not a must we can use them to identify easily.

由于一次又一次地发出相同的命令不是一种实用的方法,因此我们通常更喜欢脚本。 bash和ksh都具有脚本功能。 虽然扩展不是必须的,但我们可以使用它们轻松识别。

Bash have script extension .sh

Bash具有脚本扩展名.sh

Korn shell have script extension .ksh

Korn Shell具有脚本扩展名.ksh

编程功能 (Programming Features)

Both of the shells provides programming features. Their syntax is similar to each other. Korn shell provides more features than bash because it is designed to be superior than programming rich shells like C Shell, TC shell, Bourne shell.

这两个外壳程序均提供编程功能。 它们的语法彼此相似。 Korn Shell提供了比bash更多的功能,因为它的设计要优于对丰富的Shell(例如C Shell,TC Shell,Bourne Shell)进行编程。

性能 (Performance)

Bash have decent performance while running commands in the interactive shell or as a script.

在交互式shell中或作为脚本运行命令时,Bash具有不错的性能。

Korn shell provides a little bit more performance for command execution and scripts.

Korn Shell为命令执行和脚本提供了更多性能。

特征 (Features)

As we can see from first part the size of the ksh binary is bigger than bash.

从第一部分可以看出,ksh二进制文件的大小大于bash。

Bash provides rich feature set.

Bash提供了丰富的功能集。

Korn shell provides rich feature set which exceeds the bash features but this may require more time to learn. Korn shell have printcommand which behaves better than bash echo .

Korn Shell提供了丰富的功能集,超过了bash功能,但这可能需要更多的时间来学习。 Korn shell具有print命令,其行为优于bash echo

LEARN MORE  Linux Bash How to Define, Use Shell Variables
了解更多Linux Bash如何定义,使用Shell变量

翻译自: https://www.poftut.com/difference-korn-shell-ksh-bash/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值