eeek.. Ok so I am still having a problem.. So maybe I should explain a little further what I am doing.
Yes "Do nothing" was just something I put in there so the forum would know I am not doing anything there.
I have have a script that runs date, time and wget commands 1-9 times in a row over ssh. It records the results to a .txt file
Code:
ssh
[email protected] "( time wget -o tmp/wgetlog $accelurl -O /dev/null ) 2> tmp/timelog"
timestamp=`
[email protected] date +"%r"`
echo -e "Time location: $timestamp" >> myresults
ssh
[email protected] "( time wget -o tmp/wgetlog $accelurl -O /dev/null ) 2> tmp/timelog"
timestamp=`
[email protected] date +"%r"`
echo -e "Time location: $timestamp" >> myresults2
ssh
[email protected] "( time wget -o tmp/wgetlog $accelurl -O /dev/null ) 2> tmp/timelog"
timestamp=`
[email protected] date +"%r"`
echo -e "Time location: $timestamp" >> myresults3
the above example is a run of 3 times to 3 servers. as I said this could be run 1-9 times.
I then have some grep | cut commands that pull the times and speeds out and writes them to >> result.file
so then I run
Code:
for l in `cat /var/www/jobs/$filename/result.file | grep -A3 Accelerated | grep results | | cut -d: -f2 |sed 's/ //g'`
do
eval "time$c='$l'"
c=$(( $c + 1 ))
done
This will give me:
$time1
$time2
$time3
inside the variables is
$time1=0m0.623s
$time2=0m0.738s
$time3=0m0.654s
I then do the same thing for speed
$speed1=567kbs
$speed2=435kbs
$speed3=583kbs
Now I want to write to a spread sheet
Code:
echo -e "<Row ss:AutoFitHeight="0">" >> $filename.xml
echo -e "<Cell ss:StyleID="s63"><Data ss:Type="String">URL Tester</Data></Cell>" >> $filename.xml
echo -e "<Cell ss:StyleID="s63"/>" >> $filename.xml
echo -e "<Cell ss:StyleID="s63"/>" >> $filename.xml
echo -e "<Cell ss:StyleID="s63"/>" >> $filename.xml
echo -e "<Cell ss:StyleID="s63"/>" >> $filename.xml
echo -e "</Row>" >> $filename.xml
Now since I have 3 results I need to write a new row 3 times
here is an example of a filled out row
Code:
echo -e "<Row ss:AutoFitHeight="0">" >> $filename.xml
echo -e "<Cell ss:StyleID="s62"><Data ss:Type="String">$jobname</Data></Cell>" >> $filename.xml
echo -e "<Cell ss:StyleID="s62"><Data ss:Type="String">$accellurl</Data></Cell>" >> $filename.xml
echo -e "<Cell ss:StyleID="s62"><Data ss:Type="String">$date-at-site1</Data></Cell>" >> $filename.xml
echo -e "<Cell ss:StyleID="s62"><Data ss:Type="String">$time1</Data></Cell>" >> $filename.xml
echo -e "<Cell ss:StyleID="s62"><Data ss:Type="String">$speed1</Data></Cell>" >> $filename.xml
echo -e "</Row>" >> $filename.xml
So what I want to do is be able to repeat/append the above for each time there is $time1-9 or $speed1-9.
Hopefully that made sense.. I am kind of stuck on this. So any help will be greatly appreciated...
All the best
Cade