Re: [SLUG] redirecting tty to a file

From: Brian Coyle (brian@linuxwidows.com)
Date: Sun Jan 13 2002 - 18:59:31 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 13 January 2002 17:09, Mario Lombardo wrote:
> I thought redirecting tty output to a file could be done with a redirector
> ">"
>
> I'm having trouble with this in Debian:
>
> dpkg -i gcc-BLAH-BLAH.deb > /home/someuser/install.txt
>
> I don't get the entire output in the file.

There are two files that usually get sent to the tty, stdout and stderr.
You need to redirect both with something like this:

   $ dpkg -i gcc-BLAH-BLAH.deb > /home/someuser/install.txt 2>&1

stdout is (usually) assigned to file descriptor #1, strerr to #2.
Specifying '2>&1' says to send the fd #2 output to the same place
as fd #1.

HTH!

- --
GPG Key fingerprint = AE1C 123A 1153 8A63 E8A9 FAEA 111D CCB8 7527 701B

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8Qh9jER3MuHUncBsRApBdAJ0UA7jEFqLFz2bab+co4/6T5SsKkQCfTEOW
OzIgrVCusYWnncJoZwqOXcI=
=Uog3
-----END PGP SIGNATURE-----



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:46:03 EDT