#!/bin/sh # # mysql_tc218_insert.sh table tv_sec ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch8 # # Insert a new reccord into $table # $table - the table to use, ie Data # $tv_sec - time in unix seconds. # $ch1 - temperature of channel 1, kevin. # $ch2 - temperature of channel 2, kevin. # $ch3 - temperature of channel 3, kevin. # $ch4 - temperature of channel 4, kevin. # $ch5 - temperature of channel 5, kevin. # $ch6 - temperature of channel 6, kevin. # $ch7 - temperature of channel 7, kevin. # $ch8 - temperature of channel 8, kevin. # examples: # mysql_tc218_insert.sh Data 1241126275 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 # # csh> mysql_tc218_insert.sh Data `date +%s` 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 if [ $# -ne 10 ] then echo " usage: $0 table tv_sec ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch8" exit 1 fi # narg=$# dbname=spex table=$1 tv_sec=$2 ch1=$3 ch2=$4 ch3=$5 ch4=$6 ch5=$7 ch6=$8 ch7=$9 ch8=${10} # mysql --host=irtfweb.ifa.hawaii.edu --user=spex --password='XXXXX' -t <