[will@localhost ShellScript]$ cat while.sh#!/bin/sh
s=0i=0while [ "$i" != "10" ]do
i=$(($i+1)) s=$(($s+$i))
doneecho "The result of '1+2+3+...+10' is ==> $s"
[will@localhost ShellScript]$
張貼留言
沒有留言:
張貼留言