#!/bin/bash
exec 5<>trace.log
BASH_XTRACEFD=5
set -x
str=""
for i in {1..9}; do
  str="$str$i"
  echo "$str" >&2
done
set +x
