to myself 的分类学习日志

做自己想做的事
posts - 232, comments - 6, trackbacks - 0, articles - 0

shell programing

Posted on 2010-08-12 11:35 kongkongzi 阅读(199) 评论(0)  编辑 收藏 引用 所属分类: linux
#!/bin/bash
i=1     # define a variable. Note: No spaces.

while
        true
do
     
if [ $i -eq 1 ] # "[" and "]" is for testing.  $i is the reference value. Note: Spaces.
     then
        echo 
"i is equal to 1."
        i
=0
     
else
        echo 
"i is not equal to 1."
        i
=1
     fi
        
sleep 1s
done