The Linux Shell Series Tutorial (17) Shell file contains

Source: Internet
Author: User

This article is part of the Linux Shell Series tutorial (17), more Linux shell tutorials: Linux Shell Tutorials

Through file inclusion, you can reference the contents of other files, or you can separate complex content to make the program structure clearer.

So the high-level language supports file inclusion or package references, and the shell, of course, supports it, followed by a description of what the shell file contains.

One, Shell file contains the format

The shell file contains the following format, using the dot number "." + file name contains:

. FileName

or source+ file name:

SOURCE filename
Second, Shell file contains example

The shell file contains the following examples:

The num1.sh file is as follows:

num1=1num2=2

The num2.sh file is as follows:

#!/bin/sh#author:linux University #url:www.linuxdaxue.com#date:2016-06-02. ./num1.shecho "NUM1 =" $num 1echo "num2 =" $num 2

Output after performing num2.sh

#./num2.sh NUM1 = 1num2 = 2

As can be seen, num2.sh has included num1.sh.

Shell file contains relatively simple, first introduce to you here.

For more Linux shell tutorials see: Linux Shell Series Tutorials

  • Copyright Notice: original article, 3 months ago, published by the University of Linux (linuxdaxue.com), a total of 513 words.
  • reprint Please specify: Linux Shell Series Tutorial (17) Shell file contains | Linux University

The Linux Shell Series Tutorial (17) 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.