[HPADM] RE : [SUMMARY] duplication of standard output

From: HAUTECOEUR Bruno (HAUTECOB@ESSILOR.fr)
Date: Fri Oct 01 2004 - 10:12:37 EDT


Well ... many many answers ! Thanks to everybody.
 
The general answer is to use "tee". I think i will use it to run the
'script2 | tee logfile' from another script1.
 
Thanks for the answer from Mexico (Oliva, Gerardo
[Gerardo.Oliva@acs-inc.com])
 
regards from France ;-)
 
Bruno
 
 
 
 

-----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