[Gllug] This morning's shell script question
addw at phcomp.co.uk
Thu May 24 08:05:02 UTC 2007
On Thu, May 24, 2007 at 08:49:04AM +0100, Richard Jones wrote:
> From a shell script I want to run a command and sends the command's
> stderr to a pipe (to the logger command, in fact). But leave
> stdin/stdout connected to the terminal as normal.
> How do I do that?
The following works with ksh:
od -c > x |&
exec 1>&p 2>&3
(date writes to stdout - which goes to od -c and thence to the file x,
w write to stderr which goes to the terminal)
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Gllug mailing list - Gllug at gllug.org.uk
More information about the GLLUG