Q:

Redirect bash output to file within the bash script

I'm trying to process multiple videos in a folder and produce results through redirecting their outputs to a text file. When I do this inside the bash script, it doesn't work and doesn't redirect and instead shows on screen. What should I change? How to fix it?
for f in *.mp4
do
  echo "Processing $f file..."
  # take action on each file. $f store current file name
  python myscript.py $f &> ../log-$f.txt 
done

A:

change this:
python myscript.py $f &> ../log-$f.txt

to this:
python myscript.py "$f" &> ../log-"$f".txt

I didn't check it but it should work, unless you'll have to specify absolute path,
but it's just a guess.

