Explorar o código

simplify: no need for STATUS variable

Greg Reagle %!s(int64=5) %!d(string=hai) anos
pai
achega
1839d315cb
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      tmpmail

+ 1 - 5
tmpmail

@@ -107,11 +107,7 @@ generate_email_address() {
         # valid email address
         REGEXP="[a-z0-9]+@1secmail\.(com|net|org)"
         printf "%b" "$EMAIL_ADDRESS" | grep -E "$REGEXP" >/dev/null
-
-        # Get the exit status of the command above
-        STATUS=$?
-
-        [ "$STATUS" -ne 0 ] && print_error "Provided email is invalid. Must match $REGEXP"
+        [ $? -eq 0 ] || print_error "Provided email is invalid. Must match $REGEXP"
     fi
 
     # Save the generated email address to the $TMPMAIL_EMAIL_ADDRESS file