Update benchmark.sh

demo is written on exit now, use a different way to detect the filename