Linux Set Command

Source: Internet
Author: User

1. Set-e

"Exit immediately if a simple command exits with a Non-zero status."

When this option was on, if a simple command fails for any of the reasons listed in consequences of Shell Errors or returns An exit status value >0, and was not part of the compound list following a while, until, or if keyword, and is not a PA RT of an and or or lists, and is a pipeline preceded by the! reserved word, then the shell shall immediately exit.

2. Set-o Pipefail

"If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a Non-zero status,or Z  Ero if all commands in the pipeline exit successfully. This option was disabled by default. "
When this option is set, the return value of the statement containing the pipe command becomes the last return value of the pipeline command that returns nonzero
3. Set-x

Show commands being executed

4. Set-u

Treat unset variables as an error when performing parameter expansion. If expansion is attempted on a unset variable, the shell prints an error message, and, if not interactive, exits wit H a Non-zero status.

5. Others

-b: Returns the aborted daemon immediately to the execution status - C: The file generated by the steering cannot overwrite the existing file -d:shell presets Use the hash table to memorize the instructions used to speed up the execution of the instruction. Use the-d parameter to cancel. -e: Exit the shell immediately if the instruction return value is not equal to 0. -f: The use of wildcards is canceled. -h: the location where the function is automatically recorded. -H Shell: can use "!" Add < instruction number >-k: The arguments given by the directive are treated as environment variables for this directive. -l: Record the variable name for the For loop. -m: Use watch mode. -n: reads only instructions, not actual execution. -p: Starts the precedence mode. -P: After starting the-p parameter, when executing the instruction, the symbolic connection is replaced with the actual file or directory. -t: Exits the shell after executing the subsequent instruction. -u: An error message is displayed when execution uses a variable that is not defined. -v: Displays the input values that the shell reads. -x: After executing the instruction, the instruction and the parameters below are displayed first. 

Linux Set Command

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.