[Go]linux Order execution of multiple commands

Source: Internet
Author: User

When we need to execute multiple commands at once, the commands need to be connected with a connector, and different connectors have different effects.

(1); A semicolon that has no logical relationship to the connector. When multiple commands are concatenated with semicolons, the success or failure of each command has no effect on each other, and is executed one at a time.

(2) | | Logical OR, when you connect multiple commands with this connector, the previous command executes successfully, and subsequent commands do not. The previous command execution failed and subsequent commands will not execute.

(3) && logic and when you connect multiple commands with this connector, the previous command executes successfully before the command executes, the previous command fails, and the following command does not execute, with the | | Just the opposite.

(4) | Pipe character, when you connect multiple commands with this connector, the correct output from the previous command is given to the subsequent command to continue processing. If the previous command failed, it will be an error, if the following command can not process the output of the preceding command, will also error.

[Go]linux Order execution of multiple commands

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.