Interesting bug in bash/sed

Deleted cause im an idiot.