%addusertogroup macro

Elan Ruusamäe glen at delfi.ee
Mon Mar 28 22:37:43 CEST 2005


On Monday 28 March 2005 23:15, Andrzej Krzysztofowicz wrote:
> > 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.
if it's because 'set -e' then

if ! %addusertogroup aaa bb; then
 xxx
fi

or 

%addusertogroup || { something }

will work, but this means mass commit to all specs to catch the error code 
from %addusertogroup ... :(

but i was more thinking of new macro '%isuseringroup aaa bb', which could be 
used as:
if ! %isuseringroup aaa bb; then
  %addusertogroup aaa bb
fi

this could prevent mass changes on specs ;)

-- 
glen




More information about the pld-devel-en mailing list