Sed: Difference between revisions

From DWIKI
Line 27: Line 27:
==Edit in-place==
==Edit in-place==
  sed -i
  sed -i
==match number==
sed 's/.*\([0-9]\+\).*/\1/'

Revision as of 12:20, 16 October 2024

Stream Editor

Links

Tutorials


FAQ

errror messages

sed: -e expression #1, char 32: unknown command: `\'

try

's/...

instead of

'/...


match whitespace

\s

replace newline

try tr instead:

tr -d '\n' < file


Edit in-place

sed -i


match number

sed 's/.*\([0-9]\+\).*/\1/'