0

Hi,

i have to write/as homework/ a script that shows list of all users ,users belong to group (which is main group for every user has been showed) defined as parameter of script. In the case of -c, show count of those users. TIP: /etc/passwd, /etc/group

2
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by Watael
0

hi,

want to use it with /etc/group but "permission denied" ..its a school linux server ...do u think u should use command getent? i am really newbie in this..

0
if [ "$2" = "-c" ]; then
   for i in $( grep -i "$1" $SUBOR); do
     let "pocet+=1"
   done
   echo $pocet

else
   for i in $( grep -i "$1" $SUBOR | cut -d ":" -f 1 $SUBOR); do
      echo $i
   done
fi

but still permission denied..i cannot check the result...

0

everybody should be able to read /etc/group :(
what version of linux is this?
what does print ls -l /etc/{passwd,group}?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.