What is a good windows/xp or Vista scripting language that would provide basic functionality similar to what ksh or bsh does for unix? looking to do simple/quick tasks, build parameters, call executables (.exe), redirect output.
Thanks.
What is a good windows/xp or Vista scripting language that would provide basic functionality similar to what ksh or bsh does for unix? looking to do simple/quick tasks, build parameters, call executables (.exe), redirect output.
Thanks.
Powershell is the obvious candidate, although all of what you describe above can be achieved (with some pain) in plain old command files. Note that command files support quite a range of shell-style variable substitution, redirection and other features, but they are not as good at this as unix shells. There is a good reference for command file syntax at http://www.ss64.com/ntsyntax/; this Stackoverflow question has a lot of links to Powershell resources.
You can also get unix shell ports that run on windows; the most useful ones are cygwin, unxutils and Microsoft Windows Services for Unix. Cygwin is a whole environment that is really designed for porting unix software to run on Windows. It is quite heavyweight and maps windows drive letters to a path in the form /cygdrive/c/...
, so paths are not compatible with native win32 commands. Unxutils is based on mscvrt.dll and will use native win32 C:\
style paths, which means it is compatible with native windows commands. This makes it much better for integrating unix scripting type functionality (including sed and awk) with existing windows command line utilities.
Windows also comes with windows script host which will let you script things that support a COM API. This supports vbscript and javascript and has various API's of its own.
Finally, there are a range of third party scripting languages such as Python or Perl that will run on Windows. Good windows distributions of these languages can be obtained from Activestate - Activestate python is a very mature and stable system. You can also use a .Net version of Python called IronPython that will natively use .Net libraries.
In fact, most scripting languages have a reasonably mature windows port.
I'd vote NXC's answer up if I had any more votes for today. I myself use a little Perl (ActiveState), some batch files, and javascript myself. Powershell is the most recent addition.