2021年4月8日星期四

Script to filter users

How can I create a script that filters users on the system? For example, if there were no user named mike:

$ echo "root peter pulse mike" | ./script.sh  root peter pulse  

And other criteria like:

-s:  Keep users who have sudo rights  -I:  Keep users with a user ID >= 1000  

Here's what I have so far:

#/bin/bash    grep /etc/passwd | cut -f1 -d ":" >> user.txt  

How can I implement the if statements to check that the stdin equals the users for output?

https://stackoverflow.com/questions/67013559/script-to-filter-users April 09, 2021 at 08:37AM

没有评论:

发表评论