Die (' 1 ') Die () and exit () are all abort script execution functions; the two names of Exit and die refer to the same function, and die () is the alias of the exit () function. The function accepts only one parameter, either a value returned by a
The exit and exit status codes exit are used to end a script, just like in C. it also returns a value, which is passed to the parent process of the script. The parent process uses this value for further processing. each command returns an exit
Exit and exit Status Codes
Exit is used to end a script, just like in C. it also returns a value, which is passed to the parent process of the script. The parent process uses this value for further processing.
Each command returns an exit status
Linux Shell Bash with special meaning exit code purpose descriptionThe exit command exits the current shell and can terminate the current script execution in a shell script.Common parametersFormat: Exit nExit. Set the exit code to N. (cause the
General PracticeCat>test.SH"'#!/bin/Bashexit_script () {Exit1}Echo "before Exit"Exit_scriptEcho "After exit"EOFchmodA+x test.SH./test.SHEcho$?# output before exit1You can see that direct use exit can exit the script, and you can pass the error code
Original link: http://codingstandards.iteye.com/blog/836625 (reproduced please specify the source)Description of UseThe exit command exits the current shell and can terminate the current script execution in a shell script.Common parametersFormat:
For more information about the list of all "script stories" columns, click here.
From: http://www.microsoft.com/china/technet/community/columns/scripts/sg0904.mspxContent on this page
The worm crawls in, but does not leave.
1. Graceful exit of the process 1.1.kill-9 PID problemsIt is easy and efficient to force a process to be killed by Kill-9 PID on Linux, so many program stop scripts often choose how to use the kill-9 PID.Whether the Kill-9 PID of Linux or the
1. IntruductionExitmakeShell(script) to exit with a specified status value, Execute without parametersExitwhen, Shellor the script exits with the status value of the last execution command. Shellbefore exiting, Trapcan huntEXITsignal. 0indicates
ExitCommandExit The procedure used to control the program and the expression, there is an exit function in the General programming language, also exists in the Linuxshell.Exit 0Exit statusStatus A number between 0-255 indicates that the return
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.