I have a shell script that I should preferably not be editing but that I would have to use the output of. Doing ./SomeScript.sh -d
displays the output I need on the shell.
However, I get an empty file if I try to redirect the output.
./SomeScript.sh -d > temp
cat temp
After checking Why redirecting output sometimes produces an empty file?, I have also tried echo $(./SomeScript.sh -d)
but the command prints nothing.
Initially I was trying to grep
a line from the output, but after realising that nothing was returned, I tried to redirect the output to a file instead and realised this problem. Any idea why this might be happening?
temp
script where the output was redirected to, yes, there's one empty line – IceTea Mar 11 '21 at 03:57