l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 Oct 09 05:57

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] bash question - how to read specifed amnt of data from a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] bash question - how to read specifed amnt of data from a file


been playing around with using a basic stamp II to collect environmental
data with very minimal setup (CdS cell and capacitor form an RC network, RC
constant is measured by BS II)

the BSII sends its data to /dev/ttyS0, and it is read in with the
command'cat /dev/ttyS0 > tmp.light &' . data is parsed by a simple awk
script and then sent to ploticus for a nice plot. the plot is updated by
running a shell script that runs the awk sript and then ploticus.

this works, but there is no way to associate a time with the data values. i
was thinking that if there was some way to have a bash script read from
/dev/ttyS0 every 10 seconds or so, save the value to a text file along with
a date stamp it would be pretty neat.

the output from the BSII looks something like this:
light_level|light_level|light_level   and so on (the delimiter is a pipe)

now to the question: does anyone know how to make bash read from a file
(i.e. the serial port) from one pipe until another pipe, and then save the
value in between to a text file?

i know this is asking a lot, but any pointers would be great!

thanks a lot!


vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.