Simple SED Question

I don't understand this command behavior.

echo "abc" |sed 's/a/&_&/'

The abc is passed to sed.
The sed substitutes a by a_a .
& is what matched, and the a matches an a .

1 Like

But the output is a_abc
Why?

The a becomes a_a
The following bc remains unchanged.

1 Like

Thanks alot Sir.