[OpenAFS-devel] Return value on various command
Todd M. Lewis
Todd_Lewis@unc.edu
Thu, 02 Aug 2007 08:38:50 -0400
The pts command returns 0 because it successfully listed the membership,
which was nothing.
What you want is
pts examine newuser
which will return 0 if 'newuser' exists, 1 otherwise.
El Barto wrote:
>
> Hello,
>
> I'm using shell script to create my user, for testing if the user exist
> I just do a :
>
> $ pts membership newuser
>
> The problem is that pts always set the return variable to 0.
> To bypass that I just pipe the result to wc -l because the error is
> writing on fd 2, wc doesn't count this.
>
> Is there a reason for always returning 0 ?
>
> P.S. : By the way I'm using Openafs 1.4.4
>
> Thanks.
>
--
+--------------------------------------------------------------+
/ Todd_Lewis@unc.edu 919-445-9302 http://www.unc.edu/~utoddl /
/ A bicycle can't stand alone because it is two-tired. /
+--------------------------------------------------------------+