#!/bin/bash
s='double double toil and trouble 
fire burn and cauldron bubble bubble 
tomorrow and tomorrow and tomorrow 
creeps in this this petty pace from day toto day'
sed 's/\b\([a-z]\+\)\s\1\b/\1/g' <<< "$s"