#!/bin/bash
#在進行數值計算時使用((...))實現C語言風格的循環很方便
((i=0,s=0))
#使用直到型循環
until ((i==100));do ((i++,s+=i));done
echo sum\(1..100\)=$s
shell編程之使用C語言風格的表達式計算1~100的和值
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
No more authentication methods to try,Permission denied (publickey)
the5fire
2023-11-21 09:53:05
linux有磁盤空間卻顯示不足 linux中inode使用率過高處理辦法 linux中inode使用率過高處理辦法
故宮博物院
2022-12-25 14:18:39
Unixbench:簡介及使用【轉】
張昺華-sky
2022-06-30 14:35:50
Red Bull Racing suspends junior driver Juri Vips after racist slur on live gaming stream
alterego5352
2022-06-23 04:59:35
Point of Sale (POS) Terminal Market Will Grow in Near Future 2030
chhidami.a.msg
2022-06-17 18:58:03
台灣海峽不是“國際水域” 解放軍會否采取更多措施對抗擾台外軍?
mugiseki2710
2022-06-15 18:10:39
Justin Bieber reveals facial paralysis after shows cancelled
alterego5352
2022-06-11 23:46:31
Champions League: French police looked for problems, says Liverpool mayor
alterego5352
2022-06-10 02:24:14
iuhfgdser rtyuijnhbgfd
fikik75972
2022-06-08 00:30:29
Home Water Filtration Systems Market Future Witness Significant Growth by 2030
chhidami.a.msg
2022-06-07 22:13:50
新竹外/約瀨tea232新竹茶莊超過百位精選美女 每日不定時兼職上班
lan520an109
2022-06-07 19:45:54
sdfghjmnbvcx cter trewtretre
mufajiqe
2022-06-06 04:27:43
yujhfgd rthgfbvxytre
fikik75972
2022-06-02 15:49:30
由于小维尼修斯和库尔图瓦,皇马击败利物浦赢得第14个冠军联赛冠军
aridalton69
2022-05-29 21:51:56
無預警風控?!九州LEO、THA有卦嗎?
momowqaz
2022-05-26 18:09:50