#! /bin/sh
while read username; do
finger ${username}
done < inputfile > outputfile
exit 0I saved this as finger_script.sh and copied each of the usernames to the file 'inputfile'. The 'inputfile' contained just the usernames that I cut and pasted from the mail directory in question, and looked like this:
bill frank keith user01 user05 user09
carl gary larry user02 user06 user10
dan heather mary user03 user07 user11
denise joe nancy user04 user08 user12
Running
finger_script.sh ran the finger command on each user in the 'inputfile' and immediately output a list of users that did not exist. It also created 'outputfile', which contained a list of the information on each user:
Login: bill Name: Bill Person
Directory: /home/b/bill Shell: /bin/nologon
Never logged in.
No mail.
No Plan.
Login: carl Name: Carl Guy
Directory: /users/carl Shell: /bin/nologon
Never logged in.
No mail.
No Plan.
Login: dan Name: Dan Theman
Directory: /users/dan Shell: /bin/nologon
Never logged in.
No mail.
No Plan.
0 comments:
Post a Comment