I am just checking whether the password contains a small and capital case letter, I am getting an error at line 19.
myscript.sh
myscript.sh:
#!bin/sh
read password
conditionarr=(0 0)
if [[ $password =~ [A-Z] ]]
then
condtionarr[1]=1
fi
if [[ $password =~ [a-z] ]]
then
conditionarr[0]=1
fi
if [ ${conditionarr[0]} == 1 || ${conditionarr[1]} == 1 ]
then
printf "%s" "Yes\n "
else
printf "%s" "No\n"
fi
error
The error:
./myscript.sh: line 19: [: missing `]'
./myscript.sh: line 19: 0: command not found
What is wrong inwith this code ? Can anyone tell me how to fix this?