I have a simple text of URLs in stdout. Part of the URL looks as below.
https://somedomain./xx?t=s&u=random other text
I wish to change this using sed or something from the command line to read
https://somedomain./xx?t=l&u=random other text
I have used sed -e 's/s&/l&/'
Instead of replacing s&
with l&
I am getting ls&
in the string. Is there something wrong with my command?
&
is guaranteed to be non-special on the lhs, the behaviour for\&
is unspecified, some implementations may treat it specially (if not now, maybe in a future version). – Stéphane Chazelas Mar 02 '17 at 12:07