Score:0

pipe output of do-release-upgrade to file

in flag

I'm trying to pipe the output of the do-release-upgrade command to a file in real time. It is a python script and for some reason I can't make it show the output printed to the terminal normally to a file. I tried different approaches like

python3 -u /usr/bin/do-release-upgrade -f DistUpgradeViewNonInteractive --allow-third-party > status.txt

or

script -c "/usr/bin/do-release-upgrade -f DistUpgradeViewNonInteractive --allow-third-party" status.txt

or just

do-release-upgrade -f DistUpgradeViewNonInteractive --allow-third-party > status.txt

and ofc.

do-release-upgrade -f DistUpgradeViewNonInteractive --allow-third-party | tee status.txt

I also tried different tee options like 2>&1 and I tried to set the buffer with stdbuf -o0, but none of those worked.

Is there anything special with this python script that piping doesn't work easily here?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.