Using source error handling in Ubuntu

Source: Internet
Author: User

Recently, when using Bash on Ubuntu in Windows shell script debugging, found that the use of source in the script will be error, check the Internet to understand that the original is used in Ubuntu is not bash, but the use of optimized dash, And in the dash is no source, and in bash has source, this is a bit of trouble, usually in writing scripts sometimes call the system function and some custom function, no source is really a bit inconvenient, At this point, you can use the Dpkg-reconfigure to modify the configuration dash, you can usually use the following methods to verify the use of the shell environment in your system:

[Email protected]:~# ls-l $ (which sh) lrwxrwxrwx 1 root root 4 September 9 22:09/bin/sh, Dash

Modified under:

[Email protected]:~# dpkg-reconfigure Dash

Then select No, then look at the shell environment used in the system to change to bash

[Email protected]:~# ls-l $ (which sh) lrwxrwxrwx 1 root root 4 September 9 22:09/bin/sh-Bash

At this point, you can use the source

This article is from "Jim's Technical Essay" blog, please be sure to keep this source http://jim123.blog.51cto.com/4763600/1964010

Using source error handling in Ubuntu

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.