LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-06-2008, 04:54 PM   #1
Snouser
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.

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

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

Rep: Reputation: 16
Have you looked at this? http://www.linuxquestions.org/questi...vttys0-494454/

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

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:35 AM.

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