Hey everyone.
I have been trying a few filtering scripts with both SED and PERL. So far I have both of these versions working to reformat the incoming text stream (from stdin) into the corrent format (it looks good in the terminal), but I don't think that I am doing it right because the formatted text is not available to other applications/operations... but I can see it coming through in the terminal? Is this weird?
this is my setup:
% foo.app | perlFilter.pl
Works great - I can see it in the terminal, but
% foo.app | perlFilter > text
puts nothing into the file text!
% foo.app | perlFilter | nc 127.0.0.1 5001
Shows nothing going through to
nc -l -p 5001
Running nc in verbose mode shows that nothing is going through...
Here is my PERL script:
#!/usr/bin/perl
while (<>) {
$input = $_;
chomp ($input);
printf("%s;\n\r", $input);
}
Do I need to explicitly write out to stdout or something?
I'm a newb.