Shell scripting exercises for Linux

Source: Internet
Author: User

A. Triangle Square exercise

1. Print triangles, method one, regular expressions

650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/21/ea1ad50480c4e888094441dee06b962f.png "style=" float: none; "Title=" screenshot from 2017-11-21 21-34-44.png "alt=" Ea1ad50480c4e888094441dee06b962f.png "/>


Method two, loop nesting

I control line

J Control Printing symbols

650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/21/e08401143190fdb2eb60e1ef084e1528.png "style=" float: none; "Title=" screenshot from 2017-11-21 21-35-01.png "alt=" E08401143190fdb2eb60e1ef084e1528.png "/>


2. Reverse the Print triangle

I control line

J Control Printing symbols

650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/21/9fbf16bc45e1da22114e12485eb3fea5.png "style=" float: none; "Title=" screenshot from 2017-11-21 21-35-17.png "alt=" 9fbf16bc45e1da22114e12485eb3fea5.png "/>


3. Printing a positive triangle

I control line

J Control Printing the Space

H Control of printed symbols

650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/21/2a120ea1b7811b1f2e1b7dc86315aa16.png "style=" float: none; "Title=" screenshot from 2017-11-21 21-48-34.png "alt=" 2a120ea1b7811b1f2e1b7dc86315aa16.png "/>


3. Print a square

I control line

J Control Printing the symbol

650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/21/0ce8d4cee744ab7b2d0fa386a01f8763.png "style=" float: none; "Title=" screenshot from 2017-11-21 21-54-29.png "alt=" 0ce8d4cee744ab7b2d0fa386a01f8763.png "/>


Shell scripting exercises for Linux

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.