sout2str.pl 270 B

12345678910111213141516
  1. #!/usr/bin/perl
  2. use FileHandle;
  3. while (<STDIN>) {
  4. if (/output to serial port : /) {
  5. ($string) = /output to serial port : (.*)/;
  6. $string =~ s/\\n/\n/;
  7. $string =~ s/\\r/\n/;
  8. $string =~ s/\\t/\t/;
  9. print "$string";
  10. STDOUT->autoflush();
  11. }
  12. }
  13. # End of program