01-28-2006, 10:00 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
You were almost there.
tee only does stdout so as you expected you have to redirect stderr to stdout:
bash 2>&1 |tee file
You have to do the redirect for the command itself it can't be set as a global before the command as you tried. Also you have to say &1 rather than just 1.
2 = stderr
1 (&1) = stdout
|
|
|