#!/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"
Standard input is empty
double toil and trouble fire burn and cauldron bubble tomorrow and tomorrow and tomorrow creeps in this petty pace from day toto day