title: how to create a bulk mysql upload script in linux
body: <p>I have a mysql datbase with a tables that have the same column names as csv files that i recieve.  I used to use a windows batch file to upload then into mysql.</p>
  
  <pre><code>@echo off
  echo TRUNCATE TABLE `alarms`; &gt; importalarm.sql
  echo Creating list of MySQL import commands
  for %%s in (*.csv) do 
    echo LOAD DATA LOCAL INFILE '%%s' INTO TABLE `alarms` 
         FIELDS TERMINATED BY ',' ENCLOSED BY ' ' 
         ESCAPED BY '/'LINES TERMINATED BY '\r\n' IGNORE 1 LINES; &gt;&gt; importcsv.sql;
  echo mysql -u root -p uninetscan &lt; importalarm.sql
  </code></pre>
  
  <p>I need to turn this into a linux script.</p>
  
  <p>Any ideas.</p>