#!/bin/bash function send_mail(){ echo '报警' } function check(){ if [[ 2 -gt 1 ]];then send_mail fi } function main(){ check } main
#!/bin/bash function send_mail(){ echo '报警' } function check(){ if [[ 2 -gt 1 ]];then send_mail fi } function main(){ check } main