Ubuntu "set illegal option-O pipefail"

Source: Internet
Author: User
By default, the Ubuntu shell is installed with Dash instead of bash.
Run the following command to view the sh details and confirm the corresponding Shell ProgramWhich is:
$ LS-Al/bin/sh

Dash is lighter and faster than bash. Bash is more commonly used.
If some commands and scripts cannot be executed normally, it may be the reason for Dash.
For example, compile androidSource codeIf Dash is used, compilation errors may occur, or the compiled system cannot be started.

You can switch shell back to bash in the following ways:
$ Sudo dpkg-reconfigure dash
Then select no or no and confirm.
In this way, Dash is reconfigured and is not used as the default shell tool.

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

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

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.