I got the answer to my problem by emailing tod of todbot.com, very helpful guy who knows this stuff inside out. My problem was that my server system was switching the DTR line which causes modern boards to reset ( the auto reset function ). He suggested a patch to make ardunio.serial.c work and I worked out the mods to the publicised 'linux and stty' to make it work.
This is how you read your arduino duemilanovo board using bash :
set your sketch to Serial.println your data out - just stick it in so it does it over and over in the void loop.
stty -F /dev/ttyUSB0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts -clocal
cat /dev/ttyUSB0|head -n 2|tail -n 1
the stty line is the same as :
with -clocal appended to get over the DTR problem. If your Arduino isn't on /dev/ttyUSB0 or your
Serial.begin() isn't set to 115200 adjust to suit.
The cat line reads it twice, and returns the second, because it sometimes misses part of the first read.