title: Revising BASH script to work on whatever file I tell it to
body: <p>I've written a bash script to run a series of commands, culminating in a file called <code>DataAudit.txt</code>. It works great... if the file I am working with happens to be called <code>file.csv</code>. </p>
  
  <p>I'm very new to all of this and not sure how to write the script so it can work on whichever file I want to audit. </p>
  
  <p>The script, called <code>audit.sh</code>, lives in a folder called <code>PurgatoryCSV</code> and the idea is that I would drop a file in there, run the script, and move the file to the next step in my workflow.</p>
  
  <p>I would be grateful for any help I could get with this roadblock. </p>
  
  <p>Here is the script:</p>
  
  <pre><code>#!/bin/bash
  
  echo -n "DATA AUDIT
  
  ------------
  COLUMN NAMES
  ------------
  
  " &gt; DataAudit.txt
  csvcut -n file.csv &gt;&gt; DataAudit.txt
  echo -n "
  
  ---------------------------------------
  FIRST TEN ROWS OF FIRST FIVE COLUMNS 
  ---------------------------------------
  
  " &gt;&gt; DataAudit.txt
  csvcut -c 1,2,3,4,5 file.csv | head -n 10 &gt;&gt; DataAudit.txt
  echo -n "
  
  ------------
  COLUMN STATS
  ------------
  
  " &gt;&gt; DataAudit.txt
  csvcut file.csv | csvstat &gt;&gt; DataAudit.txt
  echo -n "
  
  ---END AUDIT" &gt;&gt; DataAudit.txt
  </code></pre>