SOMEVAR remains empty because groupadd does print any text to the STDOUT stream.
It does return an error code like so
groupadd g_$1
ERROR_CODE=$?
if [ $ERROR_CODE -eq 0 ]; then
echo "It worked"
else
echo "Ooops, It failed"
fi
On Thu, 2005-11-10 at 11:38 +0100, Verner Kjærsgaard wrote:
Hi list and Royce, - please forgive me, this is somewhat off topic... 1st., thanks for an excellent script. It will come in handy in many cases. My question: I can't get a construct (bash) like the one you use to work. I try SOMEVAR=`groupadd g_$1` if [ "$SOMEVAR" = "" ]; then echo Group created exit 0 else echo Some error occurred exit 1 fi My problems is that the variable SOMEVAR remains empty no matter what I do. What am I missing? Med venlig hilsen/Best regards Verner Kjærsgaard ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _____________________________________________________________________ Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto: https://lists.sourceforge.net/lists/listinfo/ltsp-discuss For additional LTSP help, try #ltsp channel on irc.freenode.net
|
signature.asc
Description: This is a digitally signed message part
