Scroll to navigation

SD(1) General Commands Manual SD(1)

NAME

sd

SYNOPSIS

sd [FLAGS] find replace_with [FILES]

FLAGS

Emit the replacement to STDOUT

Treat expressions as non-regex strings.

Treat expressions as non-regex strings. /** Regex flags. May be combined (like `-f mc`).

c - case-sensitive i - case-insensitive m - multi-line matching w - match full words only

EXIT STATUS

0
Successful program execution.

1
Unsuccessful program execution.

101
The program panicked.

EXAMPLES

$ echo 'lots((([]))) of special chars' | sd -s '((([])))' ''
lots of special chars
$ echo 'lorem ipsum 23 ' | sd '' ''
lorem ipsum 23
$ echo 'cargo +nightly watch' | sd '(0(24
cmd: cargo, channel: nightly, subcmd: watch
$ echo "123.45" | sd '(?P<dollars>+).(?P<cents>+)' '$dollars dollars and $cents cents'
123 dollars and 45 cents
$ sd 'window.fetch' 'fetch' http.js
$ sd 'window.fetch' 'fetch' < http.js