1835924 Members
2525 Online
110088 Solutions
New Discussion

check_old_logins.sh

 
leereg_6
Advisor

check_old_logins.sh

 
3 REPLIES 3
harry d brown jr
Honored Contributor

Re: check_old_logins.sh


Isn't the "-q" (dash-queue) option a GNU grep thing?

live free or die
harry
Live Free or Die
John Poff
Honored Contributor

Re: check_old_logins.sh

Harry,

The '-q' option for grep is valid for HP-UX also. It tells grep to run quietly. Here is part of the 'grep' man page (11.00):

-q (Quiet) Do not write anything to the standard output, regardless of matching lines. Exit with zero status upon finding the first matching line. Overrides any options that would produce output.


What I'm trying to figure out about this script is why they use 'more' on the /etc/passwd file to pipe to a grep command:

DEPT=$(more /etc/passwd | grep ^$USER: |cut -d: -f5 | cut -d"," -f3)

When you could just do something like this?:

DEPT=$(grep '^$USER:' /etc/passwd|cut -d: -f5 | cut -d"," -f3)

JP


leereg_6
Advisor

Re: check_old_logins.sh

Hi,
I am in a mixed network with both SOLARIS and HP-UX, and my NIS master is solaris 2.6, does the script work yet? How does it realize across my NIS enviroment?


Thanks!