title: Excluding files from logrotate when one filename contains brackets
body: <p>I need to exclude filenames containing a certain string from logrotate.
  Currently I have tried this common solution in the logrotate.conf file:</p>
  
  <pre><code>/something/*.log {
    daily
    rotate 30
    compress
    prerotate
       bash -c "[[ ! \"$1\" =~ unwanted ]]"
    endscript
  }
  </code></pre>
  
  <p>Unfortunately the directory includes a filename similar to:</p>
  
  <pre><code>/something/(xxx).log
  </code></pre>
  
  <p>Which results in an error when the prerotate script is run:</p>
  
  <pre><code>bash: -c: line 0: unexpected token `(', conditional binary operator expected
  </code></pre>
  
  <p>I've tried $1 without quotes, with single quotes with the same error. How can I exclude filenames containing the string "unwanted" when there are log files in the directory whose names contain brackets? </p>