(no title)
Wallacy | 3 years ago
set -e -u -o pipefail
(dos-make-addr-conf | tee config.toml) && dosctr set template_vars config.toml
well....
`tee config.toml` will still produce a empty config.toml
(set -e - u -o pipefail;false | tee config.toml) && cat config.toml
But you can use the '>' operator, that will create the file only if the command runs successful:
dos-make-addr-conf > config.toml && dosctr set template_vars config.toml
faho|3 years ago
It will still create the file.
Run this in bash, zsh or fish:
It will create an empty file called "falsefile". This is because the shell opens the file before the program runs.What fixes it in your script is the `&&`. That causes the `dosctr` to only be run if the `dos-make-addr-conf` succeeded.
Wallacy|3 years ago