Isso faz o que você quer?
sed '/{\.to/b;/\.to\(_not\|\)\s/s/^\s*/sed '/{\.to/b;/\.to\(_not\|\)[[:space:]]/s/^[[:space:]]*/$ diff -ytW 48 infile <(./sed_script)
.to do | expect(.to do
.to SPACE and | expect(.to SPACE and
.to TAB | expect(.to TAB
some s some s
day x day x
.to r | expect(.to r
.tofry .tofry
not t not t
.to tab | expect(.to tab
{.to not me {.to not me
{.to nor me {.to nor me
when e when e
{.to Nope {.to Nope
.to_not BUT yes! | expect(.to_not BUT yes
{.to Oh nono {.to Oh nono
.to_notX .to_notX
.do s .do s
{.to not do me {.to not do me
so d so d
|--- Original file ----|--- modified file ----|
expect(/' file
expect(/' file
alt:
sed '/{\.to/b;/\.to\(_not\|\)\s/s/^\s*/sed '/{\.to/b;/\.to\(_not\|\)[[:space:]]/s/^[[:space:]]*/$ diff -ytW 48 infile <(./sed_script)
.to do | expect(.to do
.to SPACE and | expect(.to SPACE and
.to TAB | expect(.to TAB
some s some s
day x day x
.to r | expect(.to r
.tofry .tofry
not t not t
.to tab | expect(.to tab
{.to not me {.to not me
{.to nor me {.to nor me
when e when e
{.to Nope {.to Nope
.to_not BUT yes! | expect(.to_not BUT yes
{.to Oh nono {.to Oh nono
.to_notX .to_notX
.do s .do s
{.to not do me {.to not do me
so d so d
|--- Original file ----|--- modified file ----|
expect(/' file
expect(/' file
Amostra:
%pre%