I have a website where I'm formatting sass (.scss
) files with the sass-convert
command. Its syntax is this:
$> sass-convert original.scss formatted.scss
Since I'm in a git repo, having a separate output file is completely superfluous. My next step would be mv formatted.scss original.scss
. I would like to do something to avoid the second step. Something like
$> sass-convert original.scss %^&
Where %^&
is some magic shell/bash syntax that does what I want it to.
Is there a way I can auto-replace the output file with the input file in a single line, using bash (or another shell) syntax?
My question is different from this question because iconv
will create the output file first, which would make the input file then empty, so none of the solutions listed below will work. If you look at the answers of both of these questions, you will see that they are different. The answers for this question work for any command that does not immediately create the output file.
-i inplace
option or one could instead installmoreutils
and usesponge
– thrig Apr 19 '17 at 19:11-i
switch. Woudl you care to make that an answer? – user394 Apr 19 '17 at 19:15