Sed

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the unix category.

Last Updated: 2022-05-26

How to run multiple substitutions

Just separate them by ; in the same sed command string.

$ echo "2 + 2 = foo_bar" | sed 's/+/-/g; s/_/\&/g';
# 2 - 2 = foo&bar