-- Leo's gemini proxy
-- Connecting to freeshell.de:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini;lang=en-GB
> Intuitive find & replace CLI.
Trim some whitespace using a regular expression:
{echo 'lorem ipsum 23 '} | sd '\s+$' ''
Replace words using capture groups:
{echo 'cargo +nightly watch'} | sd '(\w+)\s+\+(\w+)\s+(\w+)' 'cmd: $1, channel: $2, subcmd: $3'
Find and replace in a file printing the result to stdout:
sd -p {'window.fetch'} {'fetch'} {http.js}
Find and replace across a project changing each file in place:
sd {'from "react"'} {'from "preact"'} $(find . -type f)
> Copyright © 2014—present the tldr-pages team and contributors.
> This work is licensed under the Creative Commons Attribution 4.0 International License (CC-BY).
-- Response ended
-- Page fetched on Tue May 21 04:34:33 2024