You are talking about a serial port such as /dev/ttyS0 (COM1 in Microsoft speak)?
It really depends on what your needs are. If you just want to log incoming data to a file, for example, your solution might be as simple as the shell command (which can be in a script):
Code:
cat /dev/ttyS0 > filename
or to just spit the data out to the screen interactively:
I can think of two issues with this. This first is the issue of permissions. To do a quick-n-dirty check to see if this will work for you, you can run the command as root. If it turns out this accomplishes what you want, you will probably want to change permissions so you can run as it as a regular user. (It's bad security to run things as root that you don't have to.)
The other thing to think about is configuring the port. Check the
man page of stty for about a kazillion settings for the port. You, of course, need to get baud rate right. You should also be careful on your echo settings or you might get an infinite loop going with each device echoing to the other.
If you want to interact with the device you might find
minicom useful.
If neither of these suggestions does what you want, perhaps you can flesh out your problem a little more.