Shell Execution Order

Source: Internet
Author: User

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/AC/wKiom1cGe1ui4oqIAABm6P93Pb8114.jpg "height=" 142 " Width= "192" alt= "Wkiom1cge1ui4oqiaabm6p93pb8114.jpg"/>


Shell script to today, I can only kept sequential execution, try to explore its more powerful features.


A main file, main, three call files Shell1, Shell2, Shell3, the calling file differs only in the display content. (no background Execution (&) is used in main, then the content is displayed after the end of the execution of the call, and then done in turn.) ) script as follows:

[email protected] lab-shell-script]$ cat Main#!/bin/bash. Shell1 &. Shell2 &. Shell3 &echo "Shell script ends."
[[email protected] lab-shell-script]$ cat shell1#!/bin/bashfor ((i=0; i<3; i++));    Do echo "$i, Hello file." Sleep 1done

Look at the results after execution, .... ( the contents of the calling file are not displayed until the main file execution finishes.) Also, the execution order of the calling file is "unordered")

[[email protected] lab-shell-script]$./mainshell script ends.1, hello Mtf[[email protected] lab-shell-script]$ 1, hello y Angtao1, hello Sunny2, hello sunny2, hello mtf2, hello Yangtao3, hello sunny3, hello Yangtao3, hello MTF



Shell Execution Order

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.