shell to for
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell to for相关的知识,希望对你有一定的参考价值。
#!/bin/bash
#echo -n "*" 不回车
#seq 9 生成1到9
for i in {1..5}
do
for j in $(seq $[5-i])
do
echo -n " "
done
for k in $(seq $[2*i-1])
do
echo -n "*"
done
echo
done
*
***
*****
*******
*********
忧化
#!/bin/bash
x=0
for i in {1..10}
do
if [ $i -gt 5 ];then
x=$[x+2]
i=$[i-x]
fi
for j in $(seq $[5-i])
do
echo -n " "
done
for k in $(seq $[2*i-1])
do
echo -n "*"
done
echo
done
*
***
*****
*******
*********
*******
*****
***
*
以上是关于shell to for的主要内容,如果未能解决你的问题,请参考以下文章
将vscode打造成无敌的IDE打造shell IDE--三大神器
解决移动端报错:Unable to preventDefault inside passive event listener due to target being treated as……(代码片段
[TIA PORTAL][CONVERT] Convert Char Array to DInt...DInt to Char Array..Useful and easy function(代码片段