Operating System - HP-UX
1753549 Members
5421 Online
108795 Solutions
New Discussion юеВ

Re: Viewing output of pwck

 
SOLVED
Go to solution
Brian Atkins
Advisor

Viewing output of pwck

Is there a method of saving the output of pwck to a file for later review? I have attempted to '>', '>>' and '-&1>'.
4 REPLIES 4
Solution

Re: Viewing output of pwck

Hi Brian!

Try this

# pwck 2>file_name

to save the output.

Bye
Brian Atkins
Advisor

Re: Viewing output of pwck

Worked great! Thanks!
Kofi ARTHIABAH
Honored Contributor

Re: Viewing output of pwck

outputs from pwck are sent to stderr (file descriptor 2) so you would have to redirect 2 to the stdout (which can be redirected to your logfile)

eg. # pwck > logfile 2>&1
nothing wrong with me that a few lines of code cannot fix!
f. halili
Trusted Contributor

Re: Viewing output of pwck

1 ) You may use this command:
# pwck 2>&1 | tee -a outfile

nobody:*:-2:-24::/:
Invalid GID
2) check your output file, note error also appears in your screen.
# more outfile

nobody:*:-2:-24::/:
Invalid GID
derekh