MySQL command via shell script (using variables in SQL)

Running mysql commands on the shell is pretty simple. However, things can get tricky if you need to enclose variables within those aprostophes in your script. Spend some time trying to figure this out.

The short sample code below shows how it can be done. Note the cats on “echo $1“. Hope this helps you as well.

  2 comments for “MySQL command via shell script (using variables in SQL)

  1. January 25, 2011 at 11:23 am

    Beneficial info and excellent design you got here! I want to thank you for sharing your ideas and putting the time into the stuff you publish! Great work!

  2. Benjamin
    January 10, 2017 at 10:15 am

    Great comments and very useful information. Great job in studying all that.

Leave a Reply

Your email address will not be published. Required fields are marked *