I have a bash script my_script
which executes:
scp -- 'somehost:*.txt' dest_dir
now, when I run this script from an interactive shell session, scp lists files as it copies them. But when I run a second script, containing:
exec 5>&1
foo=$(my_script | tee /dev/fd/5) || exit -1
(see this question for the motivation) - scp doesn't list the files as it copies them.
Why is that? And can I circumvent this other than by using scp -v
?