Unix/linux System Management Technical Manual study notes--shell

Source: Internet
Author: User
Tags echo command

Date Created: 2016/02/29

Update on: 2016/02/29

  1. Shell variables cannot be left blank on both sides of the equals sign, otherwise the shell will mistake the variable name for the command name
  2. Variables enclosed in double quotes can be replaced with * and? The file name matches the meta-character extension) and the variable extension, and the single quotation marks do not handle the variable.
  3. The left quotation mark ', which handles a mechanism similar to a double quote, is able to execute the contents of a string as a shell command, and then replace the string with the output.
  4. Cut: Divides the row into fields, the default qualifier is tab, you can change the qualifier with the-D option, and the-F option specifies which fields the output contains.
  5. Bash +x: The command will be printed before executing a command.
  6. The-n option of the echo command eliminates the usual line breaks.
  7. A command-line argument to a script can be a variable: $ $ for the first, $ $ for the second, and $ for the name (script name) used to invoke the script, $ #为命令行参数的个数, $* for all parameters, none of these 2 are counted as $ A.
  8. $? succeeded to 0 for the status of the last execution of the command exit. If it is not successful then the other parameter 1-255, called in the script also represents the state in the previous command (will be updated in real time), and when a script exit 100, then the% value becomes 100. The return value of exit can therefore be used to determine the execution state of the script.

Unix/linux System Management Technical Manual study notes--shell

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.