by ramrunner0xff · 3y ago · 0 comments
ed $3 <<EOF
g/$1/s//$2/g
w
EOF
changes all occurrences of $1 to $2 in file $3.
:)In general, I like making programs out of declarative constructs and/or literal data, because it's so much easier to do "local reasoning" with those things, as compared to imperative procedures, or heaven forefend, live objects.