Loading ...
Sorry, an error occurred while loading the content.

Re: Command to send stdout for error messages to a file

Expand Messages
  • Cameron Simpson
    ... Noting that this sends stdout _and_ stderr to the file. To send _only_ stderr to the file go: make 2 error.msg The first command sends stdout to the file
    Message 1 of 6 , Dec 4, 2004
    View Source
    • 0 Attachment
      On 22:12 04 Dec 2004, Scott Robbins <scottro@...> wrote:
      | Assuming that it's the make command that you want to check
      |
      |
      | make > error.msg 2>&1

      Noting that this sends stdout _and_ stderr to the file.
      To send _only_ stderr to the file go:

      make 2>error.msg

      The first command sends stdout to the file (">error.msg") and then
      sends stderr (2) to the same place as stdout (1) and thus both end up
      in the file.

      Cheers,
      --
      Cameron Simpson <cs@...> DoD#743
      http://www.cskk.ezoshosting.com/cs/

      Hello, my name is Yog-Sothoth, and I'll be your eldritch horror today.
      - Heather Keith <hkeith+@...>
    • ed
      ... Hash: SHA1 On Sat, 4 Dec 2004 18:48:34 -0800 (PST) ... You may find this to be of use: http://edd.link9.net/?action=docs&category=bash_redirection - -- /--
      Message 2 of 6 , Dec 5, 2004
      View Source
      • 0 Attachment
        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        On Sat, 4 Dec 2004 18:48:34 -0800 (PST)
        Servie Platon <servie_tech@...> wrote:

        > I was just wondering what is the command or syntax to
        > send or copy the error to a file?

        You may find this to be of use:

        http://edd.link9.net/?action=docs&category=bash_redirection

        - --
        /-- _| | Regards. Please note, my PGP key ID has changed.
        |-- / | | If you are planning on sending me something encrypted
        \__ \_| | please update your keyring. Debian/OpenBSD. 53C9FC6C.
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.2.4 (GNU/Linux)

        iD8DBQFBsuQ6jtZArFPJ/GwRAjmiAJ94kfXk9G7WEaGKqZ3IRogdEH038wCfRs3W
        FZzCMx/TL9yGWFwgVR+0iOA=
        =7cPU
        -----END PGP SIGNATURE-----
      • Servie Platon
        Thanks Cameron and Ed on your helpful tips. Definitely, all your hints have made a big difference. Thanks a lot! Sincerely, Servie ...
        Message 3 of 6 , Dec 5, 2004
        View Source
        • 0 Attachment
          Thanks Cameron and Ed on your helpful tips.
          Definitely, all your hints have made a big difference.
          Thanks a lot!

          Sincerely,
          Servie
          --- Cameron Simpson <cs@...> wrote:

          > On 22:12 04 Dec 2004, Scott Robbins
          > <scottro@...> wrote:
          > | Assuming that it's the make command that you want
          > to check
          > |
          > |
          > | make > error.msg 2>&1
          >
          > Noting that this sends stdout _and_ stderr to the
          > file.
          > To send _only_ stderr to the file go:
          >
          > make 2>error.msg
          >
          > The first command sends stdout to the file
          > (">error.msg") and then
          > sends stderr (2) to the same place as stdout (1) and
          > thus both end up
          > in the file.
          >
          > Cheers,
          > --
          > Cameron Simpson <cs@...> DoD#743
          > http://www.cskk.ezoshosting.com/cs/
          >
          > Hello, my name is Yog-Sothoth, and I'll be your
          > eldritch horror today.
          > - Heather Keith <hkeith+@...>
          >




          __________________________________
          Do you Yahoo!?
          Read only the mail you want - Yahoo! Mail SpamGuard.
          http://promotions.yahoo.com/new_mail
        Your message has been successfully submitted and would be delivered to recipients shortly.