what does "&" do in this sed command

I want to know the working of & here step by step using sed command:

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

Greetings,
sed implementation changes depending flavour... without knowing your architecture, it will be difficult to answer ( the - r does not exist on all)
That said, what is stopping you find out by yourself, you could then tell us what you think it does, and maybe a guru will explain thouroughly if correct or not and give you the purpose...
In this forum you are supposed to have tried by yourself first, before asking help, we are not here to do the work for you

Its also against our rules to have different identities to be able to post more than once the same thread
thread closed

1 Like