sout2str.pl 299 B

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