I have a file which appends a binary file to a bash script (in this case an ISO). It ultimately gets pulled apart, executing the bash script to install the ISO. The bash script ends in a unique string; "DATA" and during its execution the script deletes everything above and including that line.
It doesn't however remove the terminating new line which means the new file (which should just be the binary ISO data) begins with a newline, breaking the ISO.
The regex deleting the data is as follows
sed -re '1,/^__DATA__$/d'
Viewing the file with cat -e
I'm trying to match and delete the $
after __DATA__$
#cat -et file.bin
echo "I: Installation finished!"$
exit 0$
$
__DATA__$
$
3<ED>M-^PM-^PM-^PM-^PM-^