DOKK / manpages / debian 12 / sd / sd.1.en
SD(1) General Commands Manual SD(1)

sd

sd [FLAGS] find replace_with [FILES]

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

0
Successful program execution.

1
Unsuccessful program execution.

101
The program panicked.

$ 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