Extract yoast sitemap.xml to URL list

Simple bash script for extract yoast sitemap.xml to a URL list.
Copy save to extract_yoast_sitemap.sh

if [[ $# -eq 0 ]] ; then
echo β€˜run extract_yoast_sitemap.sh https://www.yourdomain.com/sitemap_index.xml output.txt’
exit 0
fi
echo β€œ# URL list” > $2main_url=$(curl -s $1 | grep β€œ<loc>” | awk -F”<loc>” β€˜{print $2} β€˜ | awk -F”</loc>” β€˜{print $1}’)for i in $main_url
do
urls=$(curl -s $i | grep β€œ<loc>” | awk -F”<loc>” β€˜{print $2} β€˜ | awk…