Författare: Jörgen (Sida 82 av 119)

Handy one-liners for SED

————————————————————————-
HANDY ONE-LINERS FOR SED (Unix stream editor)               Apr. 26, 2004
compiled by Eric Pement – pemente[at]northpark[dot]edu        version 5.4
Latest version of this file is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.student.northpark.edu/pemente/sed/sed1line.txt
This file is also available in Portuguese at:
http://www.lrv.ufsc.br/wmaker/sed_ptBR.html

FILE SPACING:

# double space a file
sed G

# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed ’/^$/d;G’

# triple space a file
sed ’G;G’

# undo double-spacing (assumes even-numbered lines are always blank)
sed ’n;d’
Fortsätt läsa

« Äldre inlägg Nyare inlägg »

© 2025 Editio Princeps

Tema av Anders NorenUpp ↑