Example Analysis of Mini Program programming with SHELL
The purpose of this article is to share with you the content of an example analysis of SHELL programming Mini Program. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Shell script example: (find the sum of 1 to 100)
# vi qiuhe.sh
#! / bin/sh # symbol #! Used to tell the system that the following parameters are the program used to execute the document
Astat1 # defines variables
Sum=0
While [$a-le 100] # while loop where-le means less than or equal to
Do
((sum=sum+a))
((a=a+1))
Done
Echo $sum
Save exit after writing wq.
# chmod + x qiuhe.sh (add executable permissions)
Several relational operators are referenced in the drawings:
When executing the script, you can use the following two methods, with reference to the attached drawing.
This summation can also be realized in one sentence.
# echo | awk'{for (item1teri)