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