shell scripts - list dead users accts and include a count at the end?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers shell scripts - list dead users accts and include a count at the end?
# 1  
Old 04-12-2011
shell scripts - list dead users accts and include a count at the end?

I am trying to show the number of dead accts or false shells running and include a count at the end. Does anyone know how to go about this? Thanks - citizencro
# 2  
Old 04-12-2011
How do you detect a dead account, no home dir? What is a false shell running? Usually, you count with something like this in the pipeline (bash):
Code:
 . . . | tee >(
  echo "Count: $(wc -l)"
 ) . . . .

BTW, tee writes stdout first, then $1.
# 3  
Old 04-12-2011
The instructions asked for this; Write each of the following shellscripts. Be sure to include the shbang line and comments.

Name the file deadusers – shows dead accounts (false shell) and includes a count at the end.

I am lost.... Thanks for your help
# 4  
Old 04-13-2011
Well, the login shell is in /etc/passwd. Dead accounts are those whose users should be removed, I guess, but I am not sure there is any convention on how to mark them. This looks helpful: The Answer Guy 32: SysAdmin: User Administration: Disabling Accounts
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Include logfile in scripts

I am also pretty new to this scripting as well. I have found some bash script files from a legacy software. I need to find out the meaning. Could anyone help me regarding the following line: LOGFILE=/export/home/test/log/test1.log where and how this log file is being saved and why this line... (5 Replies)
Discussion started by: sMark31
5 Replies

2. UNIX for Dummies Questions & Answers

tar include list

Hi, I am tarring a file as below. First,TMP_LOG_TAR.out is file which contain file path to include the file when i do tar. Second the, i am doing gzip the tarred file. Third, Sending a mail with gz file as attachment. But it fails to open the gz file in the mail tar -cf... (5 Replies)
Discussion started by: vino_hymi
5 Replies

3. Shell Programming and Scripting

Include special system characters in file count

Hi, I have a script that checks the length of each record/line in file - This seems to be working when there are no special systems character that are invisible or hidden. awk -v file=$file '{ if (filename==file) { k+=$5 if (length() <= 10 ){print size length(), "bytes " k} }... (2 Replies)
Discussion started by: asemota
2 Replies

4. Shell Programming and Scripting

Need UNIX shell scripting end to end information

Hi, I would like to learn shell scripting in UNIX. Can any one please give me the support and share the information/documents with me. If any documents please post it to aswanikumar_nimmagadda@yahoo.co.in Thanks in advance...!!! (3 Replies)
Discussion started by: aswani_n
3 Replies

5. Shell Programming and Scripting

cut but include delimiter at end

Can someone please tell me how to do this... input file - /etc/group: wheel:*:0:root,timber daemon:*:1: mysql:*:88: ...etc... giants:*:1001:dalton,bandit dalton:*:1002: bandit:*:1003: output file (my goal): giants:*:1001: dalton:*:1002: bandit:*:1003:I've come up with this: ... (3 Replies)
Discussion started by: Lewcifer
3 Replies

6. UNIX for Dummies Questions & Answers

Scripts and changing users

Hi, I am writing somescripts to shut down some services in Korn Shell. Some of the services are under different owners. For example when I want to shutdown NXserver I need to be "root", but when I shut down the webserver I need to be under a different user. Manual I would use "su root" and... (1 Reply)
Discussion started by: bonekrusher
1 Replies

7. UNIX for Dummies Questions & Answers

scripts running under different users

what command can i use to tell if a script is running under different users? (1 Reply)
Discussion started by: csnewbie
1 Replies

8. Shell Programming and Scripting

Count the users

Is there a command that counts the logged in users? for tcsh (1 Reply)
Discussion started by: aekaramg20
1 Replies

9. Shell Programming and Scripting

count from right end of string

hi all, I'm trying to use substr(p,c,l) in awk but i'd like to have the 'position' argument count from the right end of the string instead of left end. evidently, just putting a '-' sign in front of the number does not work. any ideas? cheers, kl (1 Reply)
Discussion started by: ee7klt
1 Replies

10. UNIX for Dummies Questions & Answers

shell scripts to create 100 users

Hello i need a shell script to create 100 users i am running hp-ux......... startegy is something like this craete a shell script !/bin/ksh counter=1 while do { useradd usr$counter passwd usr$counter # here begins my problem when i say passwd usr$counter #it again prompts... (9 Replies)
Discussion started by: xiamin
9 Replies
Login or Register to Ask a Question