L7 Linux Shell Summary and conditional loop statement usage

Source: Internet
Author: User
Tags greatest common divisor numeric value

1. Describe the operation principle of shell program (can be attached with necessary graphic instructions);

Shell Summary


2, summarize all the knowledge points involved in shell programming (such as: variables, grammar, command status, etc., to take the picture of Yo);


3, summarize the course of all the circular statement, the use of conditional judgment and related examples; (if (jpg|png is not exist);

echo "You say a XX")




4. Write a script: If a path does not exist, it is created as a directory; otherwise it is present and the content type is displayed; (Don't doubt it's that simple)


5, write a script to complete the following functions; Judging the given two values, which is the big or small; the method of the given number: script parameter, command interaction; (still so simple using read)


6, the sum of all the odd numbers within 100 (at least 3 methods. Yes, this is our assignment. ^_^)


7, write a script to achieve the following functions:

(1) Pass two text file path to script;

(2) Show the number of blank lines in two files and their blank lines;

(3) Show the total number of files in two files and their total number of rows;


8. Write a script

(1) Prompt the user to enter a string;

(2) Judgment:

If the input is quit, exit the script;

Otherwise, the string content of its input is displayed;


9, write a script, print 2^n table; n equals the value entered by a user; (Sorry, I'm naughty)


10, write a script, write a few functions: function 1, to achieve the sum of two numeric values, function 2, take a given two numeric value of greatest common divisor, function 3, take a given two numeric value of least common multiple; about the selection of functions, the size of two values will be provided through interactive input.


L7 Linux Shell Summary and conditional loop statement usage

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.