[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] virtusertable - Non Gui Add



"eric welling" <eric@xxxxxxxxxxx> wrote:
<snip>
 #!/bin/bash
> NAME=$1
> DOMAIN=$2
> RESULT=$3
> if [ "$1" = "" ]; then
>          echo "Usage is ./adduser.sh username domain destination"
>          exit 1
> fi
> if [ "$2" = "" ]; then
>          echo "Usage is ./adduser.sh username domain destination"
>          exit 1
> fi
</snip>

Eric, FYI, you can make the script a lot shorter by just checking whether
the last argument's length is non-zero since that will cover all cases where
the wrong # of arguments are supplied.

if ! test -z $3
then
[EXECUTE SCRIPT]
else

echo "Usage is ./adduser.sh username domain destination"
fi

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/