(no title)
ramrunner0xff | 3 years ago
ed $3 <<EOF
g/$1/s//$2/g
w
EOF
changes all occurrences of $1 to $2 in file $3.
:)ramrunner0xff | 3 years ago
ed $3 <<EOF
g/$1/s//$2/g
w
EOF
changes all occurrences of $1 to $2 in file $3.
:)
adityaathalye|3 years ago
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.