title: VLC in Bash Script
body: <p>I am attempting to write a very basic Bash script that will accomplish the same thing as this command line:</p>
  
  <pre><code>cvlc \
    'rtsp://192.168.0.66/cam/realmonitor?channel=1&amp;subtype=0&amp;authbasic=xxxxxxxxx?tcp' \
     --sout file/mp4:/mnt/recordings/camera16_2014_10_03_13.mp4 \
     --run-time=60 vlc://quit
  </code></pre>
  
  <p>Entering this into the command line works and I get the expected 60 second MP4 file.  Putting this into a bash script, I cannot seem to get all of the arguments passed to VLC correctly.</p>
  
  <pre><code>#!/bin/bash
  camname="CAMERA16"
  token="_"
  ipadd="192.168.0.66"
  runtime="60"
  cvlc "rtsp://$ipadd/cam/realmonitor?channel=1&amp;subtype=0&amp;authbasic=xxxxxxxxx?tcp --sout file/mp4:/mnt/recordings/$camname$token$(date +$Y_%m_%d_$H_$M).mp4 --run-time=$runtime vlc://quit"
  </code></pre>
  
  <p>Running this script launches VLC, not headless, and ignores the other arguments.  It does not write to a file and it never quits.  It simply connects VLC to the stream and plays the stream.</p>
  
  <p>I have tried several different ways of quoting the arguments with no success.  All suggestions appreciated.</p>