Bash custom exit status code exit

Source: Internet
Author: User


Exit is used to end a script in which the script terminates immediately when the Exit command is encountered, and the terminating exit status depends on the number following the Exit command;


Exit [n]: Custom exit status code;


An example is described.

1, did not give the script to specify the exit status code, the entire script exit status code depends on the execution of the script in the last Command status code;

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/C2/wKiom1hXo3PjhEUQAAAPZHn-Kyk394.png-wh_500x0-wm_3 -wmp_4-s_1996538377.png "style=" Float:none; "title=" $M {% (4J ' WS) $A _6{zatkw2k.png "alt=" Wkiom1hxo3pjheuqaaapzhn-kyk394.png-wh_50 "/>


2, give the script to specify the exit status code, the entire script exit status code depends on the specified exit status code;

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/BE/wKioL1hXo3iwt7UMAAAOLbOTK7M658.png-wh_500x0-wm_3 -wmp_4-s_948645291.png "style=" Float:none; "title=" Iz965[~g32 (@A_ [1t8x~7ug.png "alt=" Wkiol1hxo3iwt7umaaaolbotk7m658.png-wh_50 "/>



This article from "Xiao-ah-hehe" blog, please be sure to keep this source http://xiaoahehe.blog.51cto.com/10661299/1884030

Bash custom exit status code exit

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.