当前位置:网站首页>shell 菱形图案
shell 菱形图案
2022-06-09 01:18:00 【ghostwritten】
shell 菱形图案
special-pattern.sh
#!/bin/bash
MAX_NO=0
echo -n "Enter Number between (5 to 9) : "
read MAX_NO
if ! [ $MAX_NO -ge 5 -a $MAX_NO -le 9 ]; then
echo "WTF... I ask to enter number between 5 and 9, Try Again"
exit 1
fi
clear
for ((i = 1; i <= MAX_NO; i++)); do
for ((s = MAX_NO; s >= i; s--)); do
echo -n " "
done
for ((j = 1; j <= i; j++)); do
echo -n " ."
done
echo ""
done
###### Second stage ######################
for ((i = MAX_NO; i >= 1; i--)); do
for ((s = i; s <= MAX_NO; s++)); do
echo -n " "
done
for ((j = 1; j <= i; j++)); do
echo -n " ."
done
echo ""
done
echo -e "\n\n\t\t\t Whenever you need help, Tecmint.com is always there"
执行:
bash special-pattern.sh
Enter Number between (5 to 9) : 5
.
. .
. . .
. . . .
. . . . .
. . . . .
. . . .
. . .
. .
.
Whenever you need help, Tecmint.com is always there
bash special-pattern.sh
Enter Number between (5 to 9) : 8
.
. .
. . .
. . . .
. . . . .
. . . . . .
. . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . .
. . . . . .
. . . . .
. . . .
. . .
. .
.
Whenever you need help, Tecmint.com is always there
边栏推荐
- Leetcode: Sword finger offer 48 Longest substring without repeated characters [double pointer]
- Abviewer layout detector function and performance improvement
- A complete set of meta universe elements covering software and hardware, crossing virtual and reality, has been born
- FATFS解读(X):字符串函数
- [plotly quick start] I have drawn several exquisite charts with plotly, which is beautiful!!
- Dinner on the 68th day at home
- Ansible automatic operation and maintenance - the road of building a dream
- 127. principles of message subscription and publication
- STM32 (x) SD card protocol details
- Blazorise场景构建高性能Web应用
猜你喜欢

Installation and deployment of LNMP

2022dasctf APR x fat epidemic prevention challenge warmup PHP

Blazorise scenario to build high-performance web applications

Go language goto keyword

汇编语言集成开发环境学习笔记

前迪士尼高管称德普将回归《加勒比海盗》 继续演船长

ABViewer布局检测器功能以及性能改进

Dry goods | first glimpse of pytest test framework, which can easily hold even if the foundation is weak

Go language loop statement -for loop

Apple Announces Winner of the 2022 Apple Design Award
随机推荐
Apple Announces Winner of the 2022 Apple Design Award
Oracle index status query and index reconstruction
Today's sleep quality record 76 points
2022dasctf APR x fat epidemic prevention challenge warmup PHP
在centOS中requires SQLite 3.8.3 or higher报错
GoEasy小程序即时通讯源码 v1.1.0/基于GoEasy提供的websocket通讯服务
How to improve the security of code -- ten skills of code defensive programming
Introduction to opencv video processing
Embedded exam review
"Penalty kick" games
Is it appropriate for a 27 - year-old girl to change her career from zero to software testing?
Mongodb usage details_ 2_ Indexing and aggregation
数论 --- 朴素筛法、埃氏筛法、线性筛法
音视频的理论基础与底层技术研究资料
Infotnews | will Apple launch its NFT at the developer conference?
Several common sampling methods and principles
USDD重磅升级,成Web3.0价值之锚
What is the correct way to start a thread?
Taking the byte beating internal data catalog architecture upgrade as an example to talk about the performance optimization of the business system
A complete set of meta universe elements covering software and hardware, crossing virtual and reality, has been born