Intercept content using awk

in the shell script, I have the following variables to hold the url information:
how do I get product_patch_20190218162130_sign.pkg? Search the awk tutorials on the Internet, learn awk fundamentals
and write the following sentence:

echo $urlfile | awk-print $NF}"
but this can only intercept product_patch_20190218162130_sign.pkg?wsSecret=9cadedd6b67bb85Time=5c6ea1e7. How do I remove the inclusion? And the rest?

urlfile=http://download.example.com.cn/download/product/rules/product_patch_20190218162130_sign.pkg?wsSecret=9cadedd6b67bb85Time=5c6ea1e7


Jul.02,2022

echo $urlfile |awk -F'?' '{print $1}' |awk -F'/' '{print $NF}

clipboard.png

Menu