소스 검색

simplify: no need for STATUS variable

Greg Reagle 5 년 전
부모
커밋
1839d315cb
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  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