[HPADM] TR : duplication of standard output

From: HAUTECOEUR Bruno (HAUTECOB@ESSILOR.fr)
Date: Fri Oct 01 2004 - 08:47:55 EDT


i already have many answers ... but all say: use "tee command".
 I would insist that i want to duplicate the whole script outputs and errors
and not piping all commands in tee -a>file.
 
anyother ideas ?
 
rgds
 
 
-----Message d'origine-----
De : hpux-admin-owner@DutchWorks.nl [mailto:hpux-admin-owner@DutchWorks.nl]
De la part de HAUTECOEUR Bruno
Envoyé : vendredi 1 octobre 2004 14:28
À : hpadm
Objet : [HPADM] duplication of standard output

Hi admins

i need to duplicate standard output in a script. I have really wrote
"duplicate" and not redirect.
In man ksh, it is wrote:

>&digit The standard output is duplicated to file
                          descriptor digit (see dup(2)).

but when i use this expression, there is no duplication but only
redirection.

In the script, i use:

exec 1>file
exec 2>&1

this work fine for redirection, but not for duplication. I need outputs and
errors to be on the screen AND in a file for the whole script.

What am i missing ?

regards
________________
Bruno HAUTECOEUR
Architecte système Unix
DSI / Architecture & Systèmes - Essilor International
Tel: 33 (0)1 72 94 73 20 - Fax: 01 39 26 53 08
mail: hautecob@essilor.fr

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:43 EDT