Ubuntu Script execution Error checking idea

Source: Internet
Author: User

First, the problems encountered:

Today, a friend asked me, said in the CentOS write good script, in Ubuntu can not normal use, at that time did not care, thought is the authority is not configured well, later looked under, found that Ubuntu and CentOS default shell is different, if recorded, to avoid forgetting later:

1, Ubuntu default shell is connected to dash, while we usually write shell script used when bash. 2. Bash and dash are incompatible in some ways. So executing the same script, the results are different and may be used./*sh can be executed, and SH *.sh error. 3, Ubuntu uses dash because of its small size, high compatibility, but for the people who often use CentOS, this is more tragic, some bash executable footsteps in the dash can not be executed, script portability is not guaranteed.


Second, the solution:

1, check whether the script has X permission, if there is, then proceed to the second step 2, sudo dpkg-reconfigure dash, and then appear in the interface select NO



This article is from the "Frozen vs watermelon" blog, so be sure to keep this source http://molewan.blog.51cto.com/287340/1947107

Ubuntu Script execution Error checking idea

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.