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?
没有评论:
发表评论