I have got the following code snippet.
if [ "$2" == "azure" ] && [ -n $11 ]; then
CRED_KIND=$2
CRED_NAME=$3
CRED_UNAME=$4
CRED_PWD=$5
TWR_UNAME=$6
TWR_PWD=$7
CLNT=$8
SEC=$9
SUBS=$10
TEN=$11
credsplaybook $CRED_KIND $CRED_NAME $CRED_UNAME $CRED_PWD $TWR_UNAME $TWR_PWD $CLNT $SEC $SUBS $TEN
exit 1
fi
For some reason, even when i pass only 7 arguments, it keeps executing the if condition considering only first check and skips the second one. As per the condition, it should check if the second argument is "azure" and whether a total of 11 arguments are passed.
./createResourcesPlaybook.sh cred azure test123 myuser mypass tower towerpass
[INFO] Creating Playbook for Credential with type azure
.
.
.
rest of output