Linux--Ubuntu Dash bash

Source: Internet
Author: User

Terminal: the so-called command-line interface, also known as the command terminal, the user Input Shell Command window, and the DOS interface in Windows, similar.

Shell : The meaning of "shell" is the interface between the operating system and the user, you can use the shell in the command terminal. The shell translates user input into instructions that the operating system can handle. The shell provides some built-in commands and also supports calling out tools.

Dash: is the default shell in Ubuntu. There are a variety of shells, in addition to supporting the default POSIX standard also support different extension syntax, currently most commonly used is bash, many shell learning tutorials are for bash. In addition to not supporting arrays, Dash doesn't really have much difference with bash. In Ubuntu, you can change the default shell from dash to bash.

Buntu's shell installs dash instead of bash by default.
Run the following command to view the details of SH and confirm which program the shell corresponds to:
$ls-al/bin/sh

Dash is lighter and faster than bash. But bash is more common.
If some commands, scripts, and so on are not always executed properly, it may be the cause of dash.
For example, when compiling the Android source code, if you use dash, it is possible to compile an error, or the compiled system will not start.

The shell can be switched back to bash in the following ways:
$sudo dpkg-reconfigure Dash
Then select No or no, and confirm.
Doing so will reconfigure dash and make it not the default shell tool.

You can also directly modify the/bin/sh link file and assign it to/bin/bash:
$sudo ln-fs/bin/bash/bin/sh

Another workaround is to specify the shell to be used directly in the script file, instead of specifying SH:
For example, use #!/bin/bash or #!/bin/dash instead of #!/bin/sh.
However, this will lose the versatility of the script so that it cannot be executed under a system that does not have the script specified.

Linux--Ubuntu Dash bash

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.