#!/bin/bash

rm -f CLIM000*.dat

for i in `seq 2 9` ; do

 id=0

 echo "ID cote" >> CLIM000$i.dat

 for j in `seq 1 15` ; do

  let cote=$RANDOM%20
  let newid=$RANDOM%15
 
  ok=y
  for ID in $id ; do
   [ $newid == $ID ] && ok=n
  done 

  if [ $ok = "y" ] ; then

   [ $newid -le 9 ] && newid=" $newid"
   [ $cote  -le 9 ] && cote=" $cote"
 
   echo "$newid $cote" >> CLIM000$i.dat
   id="$id $newid"
  fi

 done
done

echo "ID cote" >> CLIM0001.dat

for j in `seq 1 15` ; do

 let cote=$RANDOM%20
 newid=$j

 [ $newid -le 9 ] && newid=" $newid"
 [ $cote  -le 9 ] && cote=" $cote"

 echo "$newid $cote" >> CLIM0001.dat
done
