Reasons for shell scripts not using source in ubuntu12.04 and solutions

Source: Internet
Author: User

Phenomenon: Prompt source:not found when source aaa.sh in shell script


Reason: Ls-l ' which sh ' hint/bin/sh-> dash

This means that the dash is used to parse.


Change Back method:

Command line execution: sudo dpkg-reconfigure dash

Select No in the interface

Again ls-l ' which SH ' hint/bin/sh-> bash


The modification succeeds, source can use ~


Description

The Dash shell is a Unix shell that is much smaller than the bash shell and is compliant with POSIX standards. Debian used/bin/bash change/bin/dash to use less disk space, provide less functionality, and get faster speeds. But then there was a run problem with the shell script test. Because of the shell script (shell scripts) that could have been run under the bash shell, there were some unexpected problems, not 100% concurrent. Ubuntu inherits Debian, so the default is the dash Shell, starting with Ubuntu 6.10. WORKAROUND: Reconfigure Shell 1. sudo dpkg-reconfigure Dash chooses No and does not use the dash Shell. 2. Use link point ln-s/bin/bash/bin/sh check is correct: ls-l/bin/sh

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.