博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
dash 和 bash
阅读量:4137 次
发布时间:2019-05-25

本文共 921 字,大约阅读时间需要 3 分钟。

1.

Bash is the shell, or command language interpreter, that will appear in the GNU operating system. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh).

Dash(Debian Almquist shell
) is a POSIX-compliant implementation of /bin/sh that aims to be as small as possible. It does this without sacrificing speed where possible. In fact, it is significantly faster than bash (the GNU Bourne-Again SHell) for most tasks.

2.

Ubuntu 的默认Shell是 Dash,

Bash 和 Dash两者语法是有区别的,详见

例如

[ string1 = string2 ] 和 [ string1 == string2 ]

bash: 支持两者

1
2
3
4
5
6
igi@gentoo ~ $ [
'a'
=
'a'
] &&
echo
'equal'
equal
igi@gentoo ~ $ [
'a'
==
'a'
] &&
echo
'equal'
equal
igi@gentoo ~ $
echo
$0
/bin/bash

dash: 只支持=

1
2
3
4
5
6
7
$ [
'a'
=
'a'
] &&
echo
'equal'
equal
$ [
'a'
==
'a'
] &&
echo
'equal'
[: 2: a: unexpected operator
$
echo
$0
dash
$

3.

如果Shell是从别的linux平台移植到Ubuntu, 应将 /bin/sh 改成bash

转载地址:http://ermvi.baihongyu.com/

你可能感兴趣的文章
Java的Properties配置文件用法【续】
查看>>
JAVA操作properties文件的代码实例
查看>>
IPS开发手记【一】
查看>>
Java通用字符处理类
查看>>
文件上传时生成“日期+随机数”式文件名前缀的Java代码
查看>>
Java代码检查工具Checkstyle常见输出结果
查看>>
北京十大情人分手圣地
查看>>
Android自动关机代码
查看>>
Android中启动其他Activity并返回结果
查看>>
2009年33所高校被暂停或被限制招生
查看>>
GlassFish 部署及应用入门
查看>>
iWatch报错: Authorization request cancled
查看>>
iWatch报错: Authorizationsession time out
查看>>
X-code7 beta error: warning: Is a directory
查看>>
Error: An App ID with identifier "*****" is not avaliable. Please enter a different string.
查看>>
X-code beta 开发iWatch项目,运行没有错误,但是某些操作一点就崩,而且找不错误的原因场景一
查看>>
Xcode 报错: Extra argument in call
查看>>
iTunes Connect 上传APP报错: Communication error. please use diagnostic mode to check connectivity.
查看>>
#import <Cocoa/Cocoa.h> 报错 Lexical or Preprocessor Issue 'Cocoa/Cocoa.h' file not found
查看>>
`MQTTClient (~> 0.2.6)` required by `Podfile`
查看>>