The second week of Linux learning; shell programming

Source: Internet
Author: User
Tags define function

Pstree-p #显示进程编号 (tree) echo $$ basic structure of #显示当前shell进程编号   scripts: #! Shebang (indicates what shell is used to open a file, typically using bash) configuration_variables #定义变量FUNCTION_DEFINITIONS # define function Main_code #主要执行命令   Syntax error in detection script bash-n/path/to/some_script Debug execution bash-x/path/to/some_script  variable naming law:  1, cannot make a reserved word in a program: for example if, for  2, can only use numbers, letters and underscores, and can not start with a number  3, see the name of the  4, uniform naming rules: Hump nomenclature (hostname or hostname)  variables= ' command ' # Assign the command execution result to the variable, you need to use the reverse single quotation mark "or $ () export variable name =" Define variable "# variable name plus export, the variable is defined as an environment variable, can be passed to the sub-process location variable: $ $ $ $ $ $ $ $*, [email  Protected], $# (show parameters a few) set #显示已定义的所有变量unset   name #删除变量   TEST command: Use [[  when there are regular expressions in the statement], generally with text or [ ]                   Test expression                 [ EXPRESSION]                   [[EXPRESSION]]read-p] Enter a content: "Variablesname#将输入的内容付给一个或多个变量   

The second week of Linux learning; shell programming

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.