#!/bin/tcsh -f
set runs=$1
#@ runs = $runs - 1
set num=1
# this includes time(step) and calculated extension
while ($num <= $runs)
   cp write_data_multi.tcl run$num
   cd run$num
   /usr/bin/tclsh write_data_multi.tcl
   cut -f 1,3 -d ' ' a8_smd_tenth.out > ../time.tmp
   cd .. 
   cut -f 2 -d ' ' hbonds$num.dat > tmp$num.tmp
@ num = $num + 1
end
#cut -f 2 -d ' ' hbonds10.dat > tmp10.tmp
paste time.tmp tmp1.tmp tmp2.tmp tmp3.tmp tmp4.tmp tmp5.tmp tmp6.tmp tmp7.tmp tmp8.tmp tmp9.tmp tmp10.tmp > hbond-ext.dat
rm -rf *.tmp
