Note: You are viewing an old version of this page. View the current version.

Convert integers to Extended Value format (bourne shell):

ev_map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-."
int_to_ev() {
  int="${1}"
  if [ ! "${int}" ]
  then
    printf "__"
    return
  fi
  [ "${int}" -lt 0 ] && int=0
  [ "${int}" -gt 4095 ] && int=4095
  hob=$(( ( ${int} / 64 ) + 1 ))
  lob=$(( ( ${int} % 64 ) + 1 ))
  printf "%s%s" "$(echo "${ev_map}" | cut -c${hob})" "$(echo "${ev_map}" | cut -c${lob})"
}

src_data() {
  cat link-20100704.log | awk -F'\t' '{ print $2 "\t" $1 }'
}

printf "http://chart.apis.google.com/chart?cht=lc&chs=1000x256&chd=e:"; src_data | head -n 768 | while read time rtt
do
  int_to_ev $(( ${rtt} / 10 ))
done