title: Bash: check if hostname is v-q* how to use wildcards?
body: <p>I have the next code and I need it to echo 1 if the hostname matches with v-qai01 or any other v-q* servers:</p>
  
  <pre><code>if [ `hostname -s` -eq `v-q*` ]; then
          echo "1"
  fi
  </code></pre>
  
  <p>Im having several errors:</p>
  
  <pre><code>./run.sh: line 3: v-q*: command not found
  ./run.sh: line 3: [: v-qai01: unary operator expected
  </code></pre>
  
  <p>Any suggestions please?</p>
  
  <p>What if I have the next case?</p>
  
  <pre><code>hostname=`hostname -s`
  
  portalesWildcard=v-*ws*
  qaiservers={'v-qai01' 'v-qai02'}
  portales={'t1wsyellar01' }
  
  
  if [[ ${hostname} = ${qaiservers} ]]; then
      echo "yes"
  fi
  </code></pre>
  
  <p>Thanks</p>