(eight) loop structure in the shell

Source: Internet
Author: User
Tags echo command

1. For loop
(1) Requirements: Can read, can change. Does not require to be able to write out completely without reference. Because embedded does not need to completely re-handwriting the shell, system administrator (server OPS, Application layer system-level management development needs to fully master the shell)

This will print 1 2 3 4 5 sequentially.

Print out the current catalog file

2. While loop
(1) There is no logical difference in the cycle of C language
(2) Be aware of a number of formatting requirements, such as: while the [] side of the [] have spaces on both sides, [] followed by a semicolon (if do on one line), i++ in the wording of the two-level brackets.

3. Echo's creation and append input file
(1) In the shell, you can use the Echo directive to create a new file and pass some content into the file. The key to creating a file and entering content is >.
(2) You can also use the echo command to append symbols >> append input to the end of an existing file.

A A.C file was created with the file content: Hello world!

(eight) loop structure in the 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.