avatar
b*e
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
avatar
q*e
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

avatar
m*m
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:

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。