The shell file contains

Source: Internet
Author: User

Like other languages, the Shell can also contain external scripts that merge the contents of the external script into the current script.

The Shell contains scripts that can be used:

    1. . FileName

Or

    1. SOURCE filename

The effect of the two methods is the same, for simplicity, the dot (.) is generally used, but note the dot (.) There is a space in the middle of the file name.

For example, create two scripts, one called Script subscript.sh, with the following:

    1. URL="http://see.xidian.edu.cn/cpp/view/2738.html"

One is the main file main.sh, which reads as follows:

    1. #!/bin/bash
    2. . . /subscript. Sh
    3. echo $url

Execute script:

$CHOMD +x main.sh./main.shhttp://see.xidian.edu.cn/cpp/view/2738.html$

Note: The included scripts do not need to have execute permissions.

The shell file contains

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.