Set-x and set + x commands

Source: Internet
Author: User

Set-x and set + x commands are used for script debugging. Set is to print the commands below it to the screen. set-x is to enable set + x, set-o is to view (xtrace), and set is to catch up with the display of a piece of code. It is valid for the entire script after the set-x is executed. [Root @ mybox bin] # ls-l/bin/bash + ls -- color = tty-l/bin/bash-rwxr-xr-x 1 root 722684 Jul 12 2006/ bin/bash for some scripts, set-x and set + x can be used together. For example, in a script: set-x # activate debugging from herewset + x # stop debugging from here, the execution method of the shell can be set, you can set the variable according to different requirements.-a indicates the modified variable for output to the environment variable. -B: immediately returns the execution STATUS OF THE terminated background program. -C: The generated file cannot overwrite the existing file. -D Shell uses the command used by the table to accelerate the execution of the command. The-d parameter can be canceled. -E. If the return value of the command is not equal to 0, exit the shell immediately. -F cancels the use of wildcards. -H automatically records the location of the function. -H Shell can use "! "Add <command number> to execute commands recorded in history. The parameters given by the-k Command are considered as the environment variables of the command. -L record the variable name of the for loop. -M uses the monitoring mode. -N: only read commands, not actually executed. -P starts the priority mode. After the-P parameter is started, the symbolic connection is replaced by the actual file or directory when the command is executed. -T run the subsequent command to exit the shell. -U: an error message is displayed when undefined variables are used during execution. -V displays the input values read by shell. -X: After the command is executed, the command and its parameters are displayed first. + <Parameter> cancel a parameter that was started by a set.

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.