I am fairly confident with bash scripting, however this seems a little over my head.
What I am attempting to do, is take a string -- IE
page_content=<div class="contact_info_wrap"><img src="http://example.com/UserMedia/gafgallery/icons/email_icon.png" style="border-width: 0px; border-style: solid;" width="40" /><img alt="" src="example.com/UserMedia/gafgallery/icons/loc_icon.png" style="border-width: 0px; border-style: solid;" width="40" />
which was found by using this:
pageCheck="example.com"
if test "${page_content#*$pageCheck}" != "$page_content"
within the then I am attempting to take each of the urls in $page_content, only containing http://example.com, and add them to an array. Though I honestly don't even know where to start! I would like to end up with something like:
This[0]='http://example.com/the/first/url/containing/example.com'
This[1]='http://example.com/the/second/url/containing/example.com'
This[2]='etc ... '
This[3]='etc ... '
Is there a simple efficient way to get this done?
mysql --login-path=myhostalias -Dywpadmin_current_content -e"SELECT page_id, page_content FROM client_content WHERE client_section_id = '$client_section_id'" | while read page_id page_content; do-- Then the code you see above