2011年3月31日 星期四

A problem about the character 0xD is be changed to 0xA

== LF/CR issue with RS232 in Linux ==

stty -F /dev/ttyS0 -onlcr
stty -F /deb/ttyS0 -icrnl


2011年3月11日 星期五

Redirect stderr to file

IO index is:
1 is stdout
2 is stderr

===Redirect stderr to 'log.txt' file===

$ someprogram  2> log.txt

===Redirect stderr to stdout===

$ someprogram 2>&1 | less

===Redirect stderr and stdout to a file===

$ someprogram &> log.txt