The Shell 13 file contains

Source: Internet
Author: User

Tags: note echo shel language src IMA http img $

As with other languages, the shell can also contain external scripts. The Execute reference script can use source or.

Example 1
#shell#!/bin/shecho "test.sh开始执行"wc -l << EOF    hello world    hello java    hello rubyEOFecho "test.sh执行结束"
#shell#!/bin/shecho "$0开始执行"source test.shecho "$0执行结束"

Example 2

Note: $ A In the reference script will output the name of the execution script, not the name of the current reference script.

#shell#!/bin/shecho "$0开始执行"echo "hello world"echo "$0执行结束"
#!/bin/shecho "$0开始执行". test.shecho "$0执行结束"

The Shell 13 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: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: