Advertisement
Promo

Office applications Toolkit

Cygwin smuggles Unix shell commands into Windows

Kurt Cagle

Published: 24 Jun 2003 15:16 BST

  • Email
  • Trackback
  • Clip Link
  • Print friendly
  • Post Comment

Software and hardware deployments within most IT shops don't usually occur all at once.

For instance, IT managers may have worked out a strategy for deploying Windows 2000 servers coexisting with Windows 98 (and even a few Windows 95) boxes. Over time, Linux servers begin to show up as well as Web servers and application servers. This raises some interesting problems for both developers and IT consultants as they work with both these systems. A subtle problem can be seen in the use of shell scripts.

As more IT shops move to mixed Windows and Linux environments, building and maintaining general utility scripts (still the mainstay of all maintenance and development programming for IT consultants) becomes a bigger headache. By using Red Hat Cygwin for Windows, you can create utility scripts that can power both your clients' Linux and Windows systems.

What the shell does
The notion of a shell is very familiar to Unix and Linux developers but isn't necessarily as obvious to consultants using Windows, where the tools for development rely much more on graphical integrated-development environments (IDEs). A shell is a text interface with the kernel, providing a number of basic (and often not so basic) features from navigating directory structures to running applications to scheduling applications to run. In versions of Windows prior to Windows 2000, DOS was a shell application, while versions since then launch a Command Shell as a process under Win2K/XP.

Shell scripts can be thought of as the invisible glue that holds together most IT shops. Consultants often write shell scripts to automate batch processes. For instance, a Web order form application may produce a purchase order (as binary data or, increasingly, as XML) that could be stored as a file or a database entry. While it's possible for the same Web process that created the file in the first place to also process this purchase order, this adds to the complexity (and hence both running time and maintainability) of the application. Instead, it's usually preferable to queue these messages in a directory or database and then periodically run a batch file that processes these messages. These batch processes are almost invariably scripts. Other scripts may periodically check logs to make sure no abnormal activity is happening (or to record information into logs in the first place), converting files from one format to another, archiving, or other activities.

Shells under Linux
DOS (or the Windows NT Command Shell) came equipped with a small set of scripting utilities, but the language has long been of secondary concern to Microsoft; you're very limited in the kind of scripts you can write. On the other hand, Linux (and the variants of Unix) have developed a number of remarkably robust shells (from ash to zsh) that not only provide a number of rich Unix commands but also include histories, the ability to work with regular expression patterns, and very sophisticated data piping capabilities.

Next

Previous

1 2


  • Email
  • Trackback
  • Clip Link
  • Print friendlyPrint with EPSON

Did you find this article useful?
127 out of 204 people found this useful


Full Talkback thread

0 comments

Company/Topic Alerts

Create a new alert from the list below:








Video icon

Video

Discussions

J.A. Watson J.A. Watson

Bumbling Imbeciles? Yes.

Thursday 17 December 2009, 6:57 AM

3 comments
CA CA

Well..

Thursday 17 December 2009, 12:51 AM

3 comments
CA CA

The sooner...

Thursday 17 December 2009, 12:42 AM

1 comment
CA CA

aye..

Thursday 17 December 2009, 12:30 AM

4 comments

Vista Upgrade Blog

Tinsel on the TARDIS

There were shepherds on the hill, and the Doctor popped his head out of the TARDIS and said "you might want to see this" and they were astounded. WHY do we pay for a TV license?... More

Post a comment

Can I have fries with that? (Consumer...

Licence policies of Tech company's have been for a long time both complicated and 'Dick Turpin-esque', people just click 'I agree' without reading the Agreement. I do the same, but... More

1 comment

This Crap Site

How utterly stupid - I am ranked #40 in the top 100 - as a member of this site..... I mean HOW utterly stupid.... I have done sweet FA, I have only rejoined this site after a 3 or... More

2 comments


Skip Sub Navigation Links to CNET Brand Links

Help

Become part of the ZDNet community.

Newsletters