Re: echo to stderr

From: Aaron Morris (aaronmorris@MINDSPRING.COM)
Date: Tue Aug 19 2003 - 18:45:37 EDT


Jim McDonald wrote:
> Hi
>
>
> #!/usr/bin/perl
> my $input = <STDIN> ;
> print STDERR "$input" ;
>
>
> Regards
> Jim McDonald

Actually it would be:

#!/usr/bin/perl
print STDERR @ARGV;
print STDERR "\n";

but you would have to run it like `script.pl "Text to STDERR"` so that
the entire text is placed in the first element of the array. Otherwise
spacing is lost.

Using perl would probably be a little :-) more memory intensive than a
simple C program.

I just though of a shell script that should work:

#!/usr/bin/ksh
exec 1>&2
echo $@

--
Aaron W Morris <aaronmorris@mindspring.com> (decep)


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:08 EDT