Carrying on from my previous post about using scripts created in Windows on Linux, here are some comparisons to show the syntax differences between Windows batch scripts and bash scripts.
Archive for June, 2012
6 Replies
Using scripts created in Windows on Linux
A few weeks ago I tried converting a Windows batch script to a Linux shell (bash) script. The syntax between windows and linux shell scripts is quite different, but I also had a problem other than syntax differences.
After modifying the script to use linux syntax (e.g. proper loops instead of labels and GOTOs), I ran the script but it returned the following message:
/bin/bash^M: bad interpreter: No such file or directory
Selecting distinct merged results from multiple tables in MySQL
I had an issue recently where I needed to get a list of keywords for one of my websites. The website uses two databases, one for the blog, and a different one for the main part of the site. So I wanted to select the unique (distinct) keywords from the keyword tables on both databases.
This is the query I ended up with, which I will explain in a moment: