Unix版 - Korn shell script |
|
|
|
|
|
b**********e 发帖数: 13 | 1 Just wonder if anyone can give some help in writing the following Korn Shell:
Unix script to check that all users in the /etc/passwd file
have a home directory and that the directory is owned by the correct
user and group. Also check that the directory has
permissions rwxr-sr-x. Generate a report of any abnormalities | q***e 发帖数: 90 | 2 you need to write a "awk" script if you could only
use shell. It could also be done with PERL.
actually, the sh script and PERL script will be almost
identical. But PERL may be easier(actually it depends whether
your are more familiar with shell or PERL).
Shell:
【在 b**********e 的大作中提到】 : Just wonder if anyone can give some help in writing the following Korn Shell: : Unix script to check that all users in the /etc/passwd file : have a home directory and that the directory is owned by the correct : user and group. Also check that the directory has : permissions rwxr-sr-x. Generate a report of any abnormalities
| m****m 发帖数: 165 | 3 Using ksh, writing a script to parse each line in /etc/passwd.
Using 'cut' or 'awk' to get the field (such as uid, gid...), compare with what
you get from running 'ls', output inconsistancy to a file.
For directory ownership, you might just compare it as a string.
【在 q***e 的大作中提到】 : you need to write a "awk" script if you could only : use shell. It could also be done with PERL. : actually, the sh script and PERL script will be almost : identical. But PERL may be easier(actually it depends whether : your are more familiar with shell or PERL). : : Shell:
|
|
|
|
|
|
|