%addusertogroup macro

Andrzej Krzysztofowicz ankry at green.mif.pg.gda.pl
Mon Mar 28 22:15:49 CEST 2005


=?iso-8859-2?Q?Pawe=B3_=AFurowski?= wrote:
> Dnia 28-03-2005, pon o godzinie 21:23 +0300, Elan Ruusamäe napisał(a):
> > i did something like this:
> > 
> > m=$(%addusertogroup http blah)
> > if [ -n "$m" ]; then
> >     echo >&2 "$m"
> >     if [ -f /var/lock/subsys/apache ]; then
> >         /etc/rc.d/init.d/apache restart 1>&2
> >     fi
> >     if [ -f /var/lock/subsys/httpd ]; then
> >         /etc/rc.d/init.d/httpd restart 1>&2
> >     fi                                                                                                                         
> > fi 
> > 
> > but this doesn't look cool at all
> 
> how about:
> 
> %addusertogroup aaa bbb
> if [ $? -ne 0 ]; then
>   do sth when failed
> fi
> 
> IMO, it should work

IMO it will not.
Any failing command (returning nonzero status) would break script execution
AFAIK. 

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry at mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Gdansk University of Technology




More information about the pld-devel-en mailing list