Sed: Difference between revisions
From DWIKI
m (→FAQ) |
m (→match number) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
=FAQ= | =FAQ= | ||
==errror messages== | |||
===sed: -e expression #1, char 32: unknown command: `\'=== | |||
try | |||
's/... | |||
instead of | |||
'/... | |||
==match whitespace== | ==match whitespace== | ||
\s | \s | ||
Line 15: | Line 23: | ||
try tr instead: | try tr instead: | ||
tr -d '\n' < file | tr -d '\n' < file | ||
==Edit in-place== | |||
sed -i | |||
==match number== | |||
sed 's/.*\([0-9]\+\).*/\1/' | |||
or | |||
sed -r 's/.*([0-9]+).*/\1/' |
Latest revision as of 12:30, 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/'
or
sed -r 's/.*([0-9]+).*/\1/'