pwdck,usrck,grpck redirecting help ">"


 
Thread Tools Search this Thread
Operating Systems AIX pwdck,usrck,grpck redirecting help ">"
# 1  
Old 05-02-2010
pwdck,usrck,grpck redirecting help ">"

I am trying to redirect the output of the commands pwdck,usrck,grpck to specific file. I tried ">" but doesn't work.

Code:
<aixtestserver@/>usrck -n ALL > /tmp/mylog
3001-664 The account for user daemon has expired.
3001-664 The account for user bin has expired.
3001-664 The account for user sys has expired.
3001-664 The account for user nobody has expired.
3001-664 The account for user lpd has expired.
3001-612 User lp has a non-existent
         or inaccessible home directory /var/spool/lp.
3001-648 The user lp has no stanza in /etc/security/user.
3001-648 The user lp has no stanza in /etc/security/user.
3001-662 User sshd is locked.
3001-612 User ldap has a non-existent
         or inaccessible home directory /home/ldap.
<aixtestserver@/>

I don't know why the output showed in the screen, not going to the file!
if i use other commands like (ls,pwd,df..etc) the redirecting work fine.
Any help please?

edit by bakunin: i have redirected a few CODE-tags your way, please feed them yourself into the posting-pipeline from now on. Thanks.

Last edited by bakunin; 05-02-2010 at 12:03 PM..
# 2  
Old 05-02-2010
Bug

Hi

we have these redirection operators in UX

0 : --> stdin
1 : --> stdout
2 : --> stderr

<aixtestserver@/>usrck -n ALL > /tmp/mylog
3001-664 The account for user daemon has expired.
3001-664 The account for user bin has expired.
3001-664 The account for user sys has expired.
3001-664 The account for user nobody has expired.
3001-664 The account for user lpd has expired.

try

# ll usrck 2>output_file

=========================================

We use "2>" for stderr redirection to tell the shell that we want to redirect the error messages instead of
stdout (for which the file descriptor value is 1). Consider the following command.
$ ll xyz
xyz not found.
$
We tried to list a file with name xyz and the command result shows that this file does not exist. This is an
error message of the ll command. Now see the following command.
$ ll xyz >abc
xyz not found.
$
We tried to redirect the output, but still the message is displayed on our screen. The redirection had no
effect because we are trying to redirect stdout while the command is generating stderr messages. Now
let us see what happens if we change ">" to "2>".
$ ll xyz 2>abc



Hope u find this useful
# 3  
Old 05-02-2010
GREAT ! Smilie

Thank you for the useful information

Thanks a lot,,!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. Programming

Redirecting output to new file for command "perldoc perllocal"

Hi, I have to redirect output of the command "perldoc perllocal" to new file which contains all the perl module installed. Currently using perldoc perllocal >> mod_data This does not contain all perl modules installed locally on machine, and each character is doubled. Please... (3 Replies)
Discussion started by: asak
3 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

7. Shell Programming and Scripting

redirecting out of "at command" to file

hi, i am trying to redirect output of at command to a file. `at -k -f "menu.sh" now + 2 minutes` > at_out but when at_out is empty file. why? how can i do this. actually i want to get job id and want to store it in file. (4 Replies)
Discussion started by: anup13
4 Replies

8. Shell Programming and Scripting

Adding custom mesg. when redirecting "exec 2>stderr.err" ?

Doubt regarding using "exec" command to redirect the STDERR to a file. e.g I did it this way. mystage.sh #!/bin/sh exec 2>stage.err .... .... cat stage.err mv: cannot move `/root/stage' to a subdirectory of itself, `/root/stage_old/stage' ls: *.zDB: No such file or... (0 Replies)
Discussion started by: snurani
0 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question