I want to process PHP files on the content but i'm only interested in the parts between < ?php ... ?>. The rest should be removed and saved to a new file. Below I've already part of the code based on the code from this page multi line sed search. But it only gives the first part in .
start="<?php"
end="?>"
temp=$(sed -n '1h;1!H;${;g;s/.*'"$start"'//pI;d;}' <<< echo $filename)
output=$(sed -n '1h;1!H;${;g;s/'"$end"'.*//p;d;}' <<< "$temp")
Somebody has a solution? awk, grep is also oké. THanks