Use string substitution and shell redirection that works with dash.