Hi All,
i want to collect all the users info whose id greater than 999 and print the groups information which they belong.
example :
for user in $(cut -d: -f1,3 /etc/passwd | egrep ':[0-9]{4}$' | cut -d: -f1); do groups $user; done
centos : centos adm wheel systemd-journal
balu : balu
Desired output :
user_name : "centos"
group_name: "centos"
user_name:"centos"
group_name:"adm"
likewise i want to print for all the users
i tried with awk syntax but it's not feasible as i need to dynamically pick the group names every time based on the ouput
Can someone please help me on this issue ?