forked from grabadabar/new_project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpasswd_group_check
33 lines (21 loc) · 1.03 KB
/
passwd_group_check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
echo "PASSWORD"
cat passwd_sles12.test|tr '\:' "\t" |awk '{print $1 "\t" $3}' > /tmp/new_passwd
cat passwd|tr '\:' "\t" |awk '{print $1 "\t" $3}' > /tmp/old_passwd
grep -vf /tmp/new_group /tmp/old_passwd
while read p; do egrep $p /etc/passwd ;done < $(grep -vf /tmp/new_passwd /tmp/old_passwd|awk '{print $1}')
echo
echo
echo
echo "GROUPS"
cat group|tr '\:' "\t"|awk '{print $1 "\t" $3}' > /tmp/old_group
cat group_sles12|tr '\:' "\t" |awk '{print $1 "\t" $3}' > /tmp/new_group
grep -vf /tmp/old_group /tmp/new_group
while read p; do egrep $p /etc/group ;done < $(grep -vf /tmp/old /tmp/new|awk '{print $1}')
cat group|tr '\:' "\t"|awk '{print $1}' > /tmp/old
cat group_sles12|tr '\:' "\t" |awk '{print $1}' > /tmp/new
grep -vf /tmp/old /tmp/new
while read p ; do egrep $p /etc/group ;done < /tmp/old
cat passwd_sles12.test|tr '\:' "\t" |awk '{print $1}' > /tmp/new_passwd
cat passwd|tr '\:' "\t" |awk '{print $1}' > /tmp/old_passwd
grep -vf /tmp/new_group /tmp/old_passwd
while read p ; do egrep $p /etc/passwd ; done < /tmp/old_passwd