On Wed, 12 Dec 2001, David Talkington wrote:
> >> var2=`/usr/bin/id -u $var1`
> >
> >Check the exit status here.
> >
> > if [ $? -eq 1 ]; then # Does not exist ...
>
> That's an unnecessary extra step. This will do:
>
> $ var=`id -u pepe` || echo "Sorry."
It all depends. The first example pos
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jeremy C. Reed wrote:
>> How do I verify if a user already exists?
>>
>> I have this, but it gives me unary error when the user doesn't exist
>> because it doens't output a numeric value.
>
>> var2=`/usr/bin/id -u $var1`
>
>Check the exit status h
On Wed, 12 Dec 2001, Richard Pruitt wrote:
> How do I verify if a user already exists?
>
> I have this, but it gives me unary error when the user doesn't exist
> because it doens't output a numeric value.
> var2=`/usr/bin/id -u $var1`
Check the exit status here.
if [ $? -eq 1 ]; then # Doe
On Wed, Dec 12, 2001 at 01:56:40PM -0800, Richard Pruitt <[EMAIL PROTECTED]> wrote:
| I have written a script that allows my admins to add a user to our SFTP server. I
|have one problem:
| How do I verify if a user already exists?
|
| I have this, but it gives me unary error when the user doe