shell programing

# !/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

你可能感兴趣的:(shell programing)