Se essa string estiver em uma variável shell e esse shell for zsh , você poderá fazer isso:
string='5 S comment=whatever Unspecific text fruit=apple animal=mouse sky=blue'
new_string=${string/(#b)(comment=*)(fruit*)/$match[2] $match[1]}
Se esse shell for ksh93 :
new_strong=${string//@(comment=*)@(fruit*)/ }
Se esse shell for um shell POSIX (como esses dois, bash ou sh dos sistemas modernos):
a=${string%%comment=*}
b=${string#"$a"}
b=${b%fruit*}
c=${string#"$a$b"}
new_string=$a$c$b
Para cada linha de um arquivo:
sed 's/\(comment=.*\)\(fruit.*\)/ /' < file
Todos os três corresponderiam à parte do comment= da esquerda para a direita fruit se houvesse mais de um por linha / string.