aboutsummaryrefslogtreecommitdiff
blob: a9f7e20bbb5ce6d6456c90d67dfc2c63f742a682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# Header.

# Add 'Bob' after the 'To:' line:
sed -i -e '/^To: $/a    Bob' data.in || die "Oops"

# Add 'From: Alice' before the 'To:' line:
sed -i -e '/^To: $/i    From: Alice'

# Note that the spacing between the 'i' or 'a' and 'Bob' or 'From: Alice' is simply ignored'

# Add 'From: Alice' indented by two spaces: (You only need to escape the first space)
sed -i -e '/^To: $/i\  From: Alice'