I am trying to capture output from an install script (that uses scp) and log it. However, I am not getting everything that scp is printing out, namely, the progress bar. <
I can't comment yet :( so I'll add an update here...
@Martin had the best solution for me although if your scp command is midway through your script then it's output may appear after commands that actually ran afterwards.
I think that is because script must run the command in a subshell but I am yet to test.
EDIT: it does indeed spawn a shell so if you need things to run (and indeed fail) in a sequential manner (like in a build script) then you would have to add some logic around the use of the script command.
i.e.
script -q -c "your command" && sleep 1
or something similar so that your parent shell waits for the child shell to finish before moving on.