if I do:
$ node foo.js > output.d.ts
is there a way to configure the shell to do not overwrite the file if it already exists? Maybe a no-clobber option?
is there a way to configure the shell to do not overwrite the file if it already exists? Maybe a no-clobber option?
Yes, there is the noclobber option:
Prevent output redirection using
>,>&, and<>from overwriting existing files.
$ echo foo > bar
$ echo foo > bar
$ set -o noclobber
$ echo foo > bar
bash: bar: cannot overwrite existing file