title: How do I pass a wildcard parameter to a bash file
body: <p>I'm trying to write a bash script that allows the user to pass a directory path using wildcards. </p>
  
  <p>For example,</p>
  
  <pre><code>bash show_files.sh *
  </code></pre>
  
  <p>when executed within this directory </p>
  
  <pre><code>drw-r--r--  2 root root  4.0K Sep 18 11:33 dir_a
  -rw-r--r--  1 root root   223 Sep 18 11:33 file_b.txt
  -rw-rw-r--  1 root root   106 Oct 18 15:48 file_c.sql
  </code></pre>
  
  <p>would output:</p>
  
  <pre><code>dir_a
  file_b.txt
  file_c.sql
  </code></pre>
  
  <p>The way it is right now, it outputs:</p>
  
  <pre><code>dir_a
  </code></pre>
  
  <p>contents of <code>show_files.sh</code>:</p>
  
  <pre><code>#!/bin/bash
  
  dirs="$1"
  
  for dir in $dirs
  do
      echo $dir
  done
  </code></pre>