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…