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

From: HAUTECOEUR Bruno (HAUTECOB_at_ESSILOR.fr)
Date: 10/01/04

  • Next message: Bob Brown: "[HPADM] Moving RP8400"
    To: hpadm <hpux-admin@dutchworks.nl>
    Date: Fri, 1 Oct 2004 16:12:37 +0200 
    
    
    

    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)
    

  • Next message: Bob Brown: "[HPADM] Moving RP8400"

    Relevant Pages

    • [SLE] Redirection puzzle
      ... Is there a way to use a combination of redirection and other utilities (like ... tee) to execute a script where ...
      (SuSE)
    • Re: Efficiency/runtime trouble - may not be Ruby-specific
      ... I'm still very much a novice - could you explain to me in simple terms ... is there a way this technique can improve this script? ... Like #1 and #5, I think - Can I really avoid floats, since I need to ... avoiding duplication is inherent. ...
      (comp.lang.ruby)
    • Re: Is there a script I can launch to ensure computer restarts into Safe Mode?
      ... every respondent in every group can ... This prevents duplication ... which does not have the switch. ... code or with a small number of script lines. ...
      (microsoft.public.windows.server.scripting)
    • Re: RC runs stuff twice?
      ... Warren Block wrote: ... mergebase.sh script adds this line to /etc/rc.conf to prevent the ... and guess what I found at the head of my /etc/rc.conf? ...
      (comp.unix.bsd.freebsd.misc)
    • RE: Duplicate entries on reports
      ... The script took care of most of the duplication but have a look below and you will see that there is still duplication. ... > HTH ...
      (microsoft.public.sms.misc)