Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 11-06-2008, 04:54 PM   #1
LQ Newbie
Registered: Feb 2006
Posts: 21

Rep: Reputation: 15
Read device and save to file with cat

I've some problems finding out how to read from the serial port, and add the value to a file. I need time-stamps or/and numbered lines if that possible.

This is what I've made so far.

cat /dev/ttyS0 < /var/www/ordna/text
Can someone give me a tip how to work it out?

Old 11-07-2008, 10:23 AM   #2
Registered: Jun 2006
Location: Winnipeg, Canada
Distribution: Slackware 12.1
Posts: 33

Rep: Reputation: 16
Have you looked at this?

For the timestamp, you can just use cat to add on the date from the 'date' command.

date | cat - (some_file/device) >> /var/www/ordna/text


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM
filesize limit on 'cat $file | sed > $file' drkstr Linux - Software 2 07-10-2006 02:47 AM
Suse's Ivtv And Lirc Don't Work, cat: /dev/video: No such device lagu2653 SUSE / openSUSE 0 12-09-2005 10:09 AM
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 08:10 AM
how to cat a text file and save it as a variable mrobertson Programming 37 07-05-2005 08:20 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration