如题。有没有懂linux的,请教个问题。我想知道/etc/passwd下gourp=1的用户,我只想显示group=1的,其他比如group=12这些都会显示,我不想显示这些怎么办?
#!/bin/bash
read -p "input your group id:" groupId
gid=${groupId:="1001"}
awk -F ":" '{print "user:" $1 "\tgroup:" $4}' /etc/passwd | grep [:]$gid$ || echo "your group is no exist"