Unbuntu Run a shell script problem

Source: Internet
Author: User

Today learn bird's private dishes, according to the book hit a few shell script, but the total error

The first is to use [] to determine the condition, = = does not work properly

The second is to declare variables in the script to use declare, always error said, not found

Find the reason on the Internet, say is the Ubuntu uses the dash instead of bash, so when executes the script to hit like the command sh scriptfile.sh to be possible the error (at this time uses dash),

But it's no problem knocking on the command bash scriptfile.sh.

To change dash back to bash, just execute the sudo dpkg-reconfigure dash and select < no > in the Interactive interface

For reference, see

Http://www.cnblogs.com/Trekshot/archive/2010/03/29/1699383.html

Unbuntu Run a shell script problem

Related Article

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.