In linux the command 'dircolors' prints out the commands to set the LS_COLORS environment variable. But it doesn't print out what is set in your LS_COLORS variable. Without knowing this, I was first confused why dircolors and 'echo $LS_COLORS' prints out different things. In the LS_COLORS there was an entry for .sh files (*.sh=00;32). This is reponsible for ls to print all the sh files in green color. From where did the LS_COLORS get this entry? I searched in the /etc/DIR_COLORS file. It had an entry, but even after commenting out that LS_COLORS still had that entry in my system.
While trying to find out what is initializing the LS_COLORS with that entry, I came across this page
This script, which is also responsible for setting up the ls alias, gets the colors from one of several possible configuration files; these are from highest to lowest priority: ~/.dir_colors.$TERM, ~/.dir_colors, ~/.dircolors.$TERM, ~/.dircolors, /etc/DIR_COLORS.$TERM, or /etc/DIR_COLORS (where $TERM is your current terminal type as specified by the TERM environment variable).
In my system, /etc/DIR_COLORS.xterm had this line (".sh 00;32"). After commenting that line I got what I expected ie. sh files to be displayed in green only if it has executable permission. I had to the same thing for .bat, .csh also.

