We have multiple servers and i would like to print users list and access level using bash.
I tried below command but could not get exact result what i wanted to:
awk '/Allow root/{p=5} p > 0 {print $1; p--}' /etc/sudoers above command just give me five entries as below
## root abcd ghfd fcff but I should get the O/P as below:
UserList AccessLevel root ALL abcd !/usr/bin/* Can i get the output as above?