Introduction: different scripting technologies for different contexts

SysAdminToolBoxLogoAs a DBA I worked on different different operating systems for different purposes.
To manage DBs I had to work with different SQL dialects for different database technologies (T-SQL, PL-SQL, SQL ANSI ’91…’99 and so on…) but to create automation, monitoring and reporting I had to write tools using different scripting tecnologies dependingon where I was working on.
There are no tools and no tecnologies for every season.
Some tecnologies are very portable or easy to rewrite/recompile for different kind of OS.
But there is always something to fix.
You can install bash on windows os (using cygwin) or you can use gcc to recompile a C tool for different platforms.
But bash is not a native tool for win server os and writing (and mantaining!) a portable C code for different OS can be a very time consuming activity.

For management my suggeston is: use the most flexible,native and portable scripting language for the kind of OS you are working on.

On windows OS my choice for management is: vbscript/jscript  and sometimes the old and trusty batch files. Sometimes I used powershell but only when it was strictly necessary because there are different versions of PS on different windows server versions with different classes available.

On *nix OS my choice is BASH: ad old and solid shell natively available on every *nix server I worked on.

update 7/8/2016: MS in collaboration with Canonical released BASH shell for windows porting a Linux Ubuntu user environment to windows. This was done mapping linux system calls to windows system calls so we have the same binaries (grep, awk, sed and so on…) on linux and windows. This is the first step to have a bash complete and stable environment on windows too. This is a VERY good news 🙂 🙂