Ravi Sir's Cards › AWS
Make sed edits repeatable?
This interview card answers: Make sed edits repeatable? Runs twice may double edits. Match the full old value. The card’s suggested next step is to set a value exactly.
Read card text
What this card says
What it is
Runs twice may double edits.
Why it matters
Match the full old value.
How / example
Set a value exactly.
sed -i 's/^Port .*/Port 2222/' sshd_config