Re: Slightly OT: check creation of a group

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> Apparently I can't seem to "negate" the test, e. g. something like
> 
> if !(grep medintux /etc/group)
> 
> Any suggestions for the correct syntax here ?
>


I'd do it like this:

grep medintux /etc/group
if [ $? != 0 ]; then
  echo "Group not found"
fi



---------------------------------
Geoff Galitz
Blankenheim NRW, Germany
http://www.galitz.org/
http://german-way.com/blog/



_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux