title: Linux bash MySQL load infile
body: <p>I'm trying to simplify a load data local infile, by putting it into a .sh file, and bash to run it. </p>
  
  <p>Here is my count_portal.sh file</p>
  
  <pre><code>mysql -h host -u root -p password 
  load data local infile
  "/workplace/user/dump/count_portal.txt" 
  replace into table test.icqa_count_portal 
  fields terminated by '\t' lines terminated by '\n' ignore 1 lines;
  </code></pre>
  
  <p>And here is my bash script</p>
  
  <p>bash <code>/home/user/Desktop/count_portal.sh</code> I get an output that doesn't do what it is designed to do. When I simply make the count_portal.sh contain <code>mysql -h host</code> it longs in when running the script.</p>