Shell Script Learning (i)

Source: Internet
Author: User
Tags logical operators

Shell Script Learning (i)

A) Introduction to code-style shell scripts

    1. Download Xshell 5

      

Build a folder Mkdri Home/data;

1) Look at a 1.sh built in data

    See if the build was successful.

2) and edit echo Hello Word, and save the launch

      

    

    3) No permissions were found when running the script. Add permissions.

    

"' Green executable script

    

  

    II) shell script commands

    1> Download Everedit Editor, other editors can also

After installation

2> variables:

1. When no that variable is the result value is empty, the value of ${name} parentheses can be added without

2.readonly system, non-reproducible, final in ==java

          

      3) Delete variable cannot be used

          

      • 1) local variable local variables are defined in a script or command, only valid in the current shell instance, and other shell-initiated programs cannot access local variables.
      • 2) Environment variables All programs, including shell-initiated programs, can access environment variables, and some programs require environment variables to keep them running properly. Shell scripts can also define environment variables when necessary.
      • 3) shell variables shell variables are special variables that are set by the shell program. Some of the shell variables are environment variables, some of which are local variables that guarantee the shell's normal operation.

      4) The difference between "and" "

 

    5) Intercept string length

          

     6) Find the location of the string (only the first one can be found, the duplicates cannot be found)

   

      7) array

 8) for Loop

          

    Operation

9) Add

           

10) Subtraction Yu

        

One) if Then

              

12) Relational operators

      

13) Logical operators

        

14)

          

  

Shell Script Learning (i)

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.