Or is it possible to call external commands from an sql script, like
\i "sed 's/this/that/' some.sql"