in reply to Which Module for Win32 Shell

I'm taking a stab at what your mean by some of these features, but with the exception of:

* Enable multiple active ODBC connections and the ability to switch be +tween them

I think that the Cygwin bash shell might suit your needs. Some of the things bash doesn't do internally can be implemented with auxiliary scripts or shell 'functions'. Specifically, bash can do:

* Command History * Multi-line command input * Enable editing of multi-line statements retrieved from history * Flowthru of DOS commands from shell * Enable predefined commands to be easily added to shell

and the rest probably can be implemented as external commands.

Maintaining active ODBC connections is a potential problem, but I see a couple of different approaches:

  1. Add this feature directly to bash (it's open source).
  2. Create an 'ODBC server process' which would accept commands from some sort of socket connection (either real socket or named pipe), direct them to the appropriate ODBC connection and return the results. The ODBC connections would persist for the lifetime of this server process.

This would require you to invent a serialization for ODBC commands and results.

Finally, another thing I'd look into is the Windows PowerShell. One of the things I remember reading about it was that it had extended the stream concept to include streams of objects, not just characters. This would be helpful if you want to pass complex data structures between processes using the pipes paradigm. For instance, how about being able to write something like:

odbc 'select * from foo' | format-html-table

The 'lines' emitted by the odbc command are really objects so that it is easy for downstream processes to correctly interpret the row data.

Replies are listed 'Best First'.
Re^2: Which Module for Win32 Shell
by TeraMarv (Beadle) on Feb 06, 2008 at 17:02 UTC
    I suppose I should have specified that this needs to be as vanilla win32 as possible. Once i've finished the tool i'd like to be able to package it as an executable for distribution among my colleagues. Not all of them have Perl, Cygwin or anything else that may make their lives easier....nore are they the types to install these things.

    I was thinking I could use a seperate DBI object for each ODBC connection and select each connection based on the string passed from the user. That makes sense doesn't it?

      If you are interested in a traditional unix type shell, the GnuWin32 project provides windows installers for traditional unix command line tools.

      Another option for unixy-goodness on Win32 is MinGW.

      Zoid, mentioned below, looks like it might be a promising starting point for you, too.


      TGI says moo