[HPADM] Scripting Question

Dan.Johansson_at_swisscom.com
Date: 08/13/03

  • Next message: Peter.Heick_at_sas.dk: "[HPADM] RE: Scripting Question"
    Date: Wed, 13 Aug 2003 15:30:46 +0200
    To: <hpux-admin@dutchworks.nl>
    
    

    Hi Gurus!

    I've a small scripting Question.

    I would like to do something like this.

    command | tee outputfile

    The problem is that I want toi get the return-code ($?) from the command
    and NOT from tee. If I do it as I've shown above i'll only get the
    returncode from tee.

    I can not send the output to a log-file and then do a cat of the file
    because I need to se the output as the command is running.

    Any suggestions on how to solve this problem?

    Regards,
    Dan Johansson
    Unix Systems Engineer
    MC-TO-MIT-SYI-UNS

    Mobile +41 (0)79 663 13 48
    Dan.Johansson@swisscom.com

    Swisscom Mobile Ltd, MC-TO-MIT-SYI-UNS, CH-3050 Bern
    Location: Poststrasse 25, CH-3072 Ostermundigen
    Phone +41 (0)31 342 51 57, Fax +41 (0)31 342 16 98,
    www.swisscom-mobile.ch

    This e-mail may contain confidential and/or privileged information. If
    you are not the intended recipient (or have received this e-mail in
    error) please notify the sender immediately and delete this e-mail. Any
    unauthorised copying, disclosure or distribution of the material in this
    e-mail is strictly forbidden.

    --
                 ---> 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: Peter.Heick_at_sas.dk: "[HPADM] RE: Scripting Question"

    Relevant Pages

    • Re: Howto parse stdout without changing it
      ... > I would like to parse stdout from a command list but also piped stdout to ... I guess you are looking for `tee`. ... echo "gzip result: $" ...
      (comp.unix.shell)
    • How to get the return code from a Unix command in Cobol
      ... I want to run a Unix command, program or script from Cobol and get its return ... the return-code is alswya zero. ... Systemforks a child process, execs it to the default shell, feeds it your ...
      (comp.lang.cobol)
    • Re: cat output to two files?
      ... > trying to get the output of a command into two different log files ... What makes you think the standard output from cat is any different from ... tee works with anything ...
      (comp.os.linux.misc)
    • Re: How to get the return code from a Unix command in Cobol
      ... Result or RETURN-CODE. ... It was zero if the command worked and non-zero ... if the CALL fails, or the SYSTEM fails, or the command file fails, ... RW> The parent Cobol program wrote 'failure' and the ...
      (comp.lang.cobol)
    • Re: bash: any way to reuse the last output?
      ... Ben Stringer wrote: ... > each time you run a command you are likely to want to reuse output from. ... What's the way to append that tee without having to type it every time? ...
      (Fedora)