Automatically restart ffmpeg on error from inside bash script
I found this method on serverfault.com and it seems to restart ffmpeg on error:

cmd="ffmpeg -re -thread_queue_size 512 -rtsp_transport tcp -i ${source_url} \
   -acodec libmp3lame  -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 \
   -i /dev/zero -vcodec libx264 -preset medium -s 1280x720 -g 6 -r 3    \
   -f flv rtmp://a.rtmp.youtube.com/live2/${youtube_stream_key}"

until $cmd ; do
        echo "restarting ffmpeg command..."
        sleep 2
done


without " " it is showing error: -re: not found