for expr multiply sleep array(reverse)

#!/bin/ksh 

SECOND_PER_MINUTE=60; 
MINUTE_PER_HOUR=60; 
SECOND_PER_HOUR=`expr $SECOND_PER_MINUTE \* $MINUTE_PER_HOUR`; 

for (( i=12; i>=1; i-- )) 
do 
    echo $i; 
    date;     
    #sleep $SECOND_PER_HOUR;     
done 

array=(a b c d e f g); 
for i in "${array[@]}" 
    do               
        echo $i;                 
    done 
     
length=${#array[*]}; 
for (( i=0,j=`expr $length - 1`; i<$length; i++,j--)) 
do 
    reverted_array[j]=${array[$i]}; 
done 

echo "----------------------------------"; 
for i in "${reverted_array[@]}" 
    do               
        echo $i;                 
    done
相關文章
相關標籤/搜索