Operating System - HP-UX
1837270 Members
2979 Online
110115 Solutions
New Discussion

how to redirect pvdisplay error output

 
SOLVED
Go to solution
S.K. Chan
Honored Contributor

how to redirect pvdisplay error output

Hi,
How do I redirect pvdisplay output that has this error ..
pvdisplay: Couldn't find the volume group to which
physical volume "/dev/dsk/c2t2d0" belongs.
pvdisplay: Cannot display physical volume "/dev/dsk/c2t2d0".
to a file. The file turned up empty and it seems this output can't
be isolated from the std output

thanks in advance
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: how to redirect pvdisplay error output

That's because it's not stdout but stderr.

Try this:
pvdisplay xxx > /tmp/log 2>&1 for everything in 1 log

or
pvdisplay xxx > /tmp/log 2>/tmp/errs to get 2 separate outputs
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: how to redirect pvdisplay error output

pvdisplay /dev/dsk/cxtydz 2>error

If you want both stdout and stderror together

pvdisplay /dev/dsk/cxtydz > output 2>&1

-Sri
You may be disappointed if you fail, but you are doomed if you don't try