back to labs
Column Commando: Repetitive Edits, Recorded Once
HardText Editors20-30 minThe brief
Inventory export time: /root/inventory/hosts.list holds 15 hosts as space-separated 'hostname ip' pairs, but the asset system wants CSV — a 'hostname,ip,managed' header line on top, every space turned into a comma, and ',managed' appended to each host line. Doing one line by hand is easy; doing 15 identically is what macros (qa … q, then 14@a), visual-block editing, or a well-aimed :%s are for. Any vim technique is fair game — what's graded is the resulting file, but your hands will teach you why recording the edit once beats typing it fifteen times.
What you'll do
- Add the header line 'hostname,ip,managed' as the first line
- Convert every host line from 'hostNN 10.x.y.z' to 'hostNN,10.x.y.z,managed'
- All 15 host lines transformed identically — no stragglers
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
