linux howto - fabio de lorenzo personal informations and experiences Forum Index linux howto - fabio de lorenzo personal informations and experiences
kernel modules and software
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Array

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    linux howto - fabio de lorenzo personal informations and experiences Forum Index -> Bash
View previous topic :: View next topic  
Author Message
root
Site Admin


Joined: 27 Apr 2004
Posts: 156

PostPosted: Mon Apr 27, 2009 11:30 pm    Post subject: Array Reply with quote

#!/bin/bash

# Configure only the next two lines
SLEEP_TIME=5
aChannelList=( 530 223 226 246 602 303 328 329 383 387 389 257 311 333 357 404 603 698 230 264 271 317 353 )


function DT_CMD_WATCH {
dt watch -channel $1
}

function LOG {
DATE_str=`/bin/date "+%Y-%m-%d-%H.%M"`
echo "$DATE_str - $1"
}


numElement=${#aChannelList[@]}

while true
do
index=0
while [ "$index" -lt "$numElement" ]
do
LOG "$index ) channel: ${aChannelList[$index]}"
DT_CMD_WATCH ${aChannelList[$index]}
sleep $SLEEP_TIME
let "index = $index + 1"
done
done
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    linux howto - fabio de lorenzo personal informations and experiences Forum Index -> Bash All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group