I've been writing a bash script to install PBIS Open when I execute the following command domainjoin-cli join $domain $join_account $password
I can see the output on the terminal. However, if I try to capture the terminal output and save the output to a file, the file is empty.
I've tried adding <cmd> > output.txt
I've tried using
script output.txt
<cmd>
exit
I've searched for a day now but I can't seem to find a working solution.
There are two types of output stream stdout
and stderr
. It is probably coming out on the stderr stream. The >
by itself will only capture the stdout
.
Try executing with
<cmd> &> filename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With