Two things.
- You need to escape the brackets in the match expression, they have special meaning in regular expressions.
- You should protect the sed script from shell expansion. Using double quotes forces expansions. Single quotes switches expansion off.
Thus:
's/mov r1, [r1, r2]/sub [r8, r9], r10/g'
While working out the correct script you can just skip the inline editing, maybe. Like so:
sed 's/mov r1, [r1, r2]/sub [r8, r9], r10/g' file.S
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…