Dec 2023
11 Mon
12 Tue
13 Wed 09:20 AM – 09:35 AM HST
14 Thu
15 Fri
16 Sat
17 Sun
Dec 2023
11 Mon
12 Tue
13 Wed 09:20 AM – 09:35 AM HST
14 Thu
15 Fri
16 Sat
17 Sun
sed is a “stream editor” that builds on top of the old ed editor. In it, you basically give short commands for how to modify the file, rather than manipulate its contents directly (although you can do that too).
Regular expressions are common and useful enough that it’s worthwhile to take some time to understand how they work. Let’s start by looking at the one we used above: /.*Disconnected from /. Regular expressions are usually (though not always) surrounded by /. Most ASCII characters just carry their normal meaning, but some characters have “special” matching behavior. Exactly which characters do what vary somewhat between different implementations of regular expressions, which is a source of great frustration. Very common patterns are: