I am running a script called upgrade.sh
ANd upgrade.sh calls a script called roll.sh
roll.sh >> logfile.text
But roll.sh has some questions and prompts, and the redirect is preventing those outputs from hitting the screen. I cannot edit roll.sh.
I also tried `results=$(roll.sh)
Even then, the output was not coming onto the screen
Use tee, it was created specifically for this purpose: to forward standard input to the screen and one or more files. Make sure to use the -a option to append to logfile.text if you don't want to overwrite it.
roll.sh | tee -a logfile.text
                        You want tee:
TEE(1)                           User Commands                          TEE(1)
NAME
       tee - read from standard input and write to standard output and files
                        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