sed
Programm: sed
Ändert Text Zeile für Zeile nach einem Skript.
Aufruf
sed [OPTION]... SCRIPT [FILE]...
Beschreibung
Run the editing SCRIPT on every line of the FILEs (or of the keyboard or pipe) and print the result. Without -e or -f the first argument is the SCRIPT. Commands: s/RE/TEXT/ replaces, d deletes, p prints, a, i and c add or change lines, y changes characters, h, H, g, G and x use the hold space, n and N read the next line, q quits.
Optionen im Simulator
6 weitere Optionen des echten Programms, im Simulator noch nicht
Beispiele
cat env.conf
API_HOST=staging.example.com
PATHS=/srv/staging:/opt/staging
DEBUG=true
sed 's/staging/production/' env.conf
API_HOST=production.example.com
PATHS=/srv/production:/opt/staging
DEBUG=true
sed 's/staging/production/g' env.conf
API_HOST=production.example.com
PATHS=/srv/production:/opt/production
DEBUG=true Wo du ihn lernst
Lektionen
- Text ändern mit sed Linux-Grundlagen, Modul 3: Text-Werkzeuge