ZDNet UK


Skip to Main Content

ZDNet.co.uk - Winner of Best Business Website 2007
  1. Home
  2. News
  3. Blogs
  4. Reviews
  5. Prices
  6. Resources
  7. Community
  8. My ZDNet

 

ZDNet UK RSS Feeds


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 friendly
  • Post Comment

Did you find this article useful?
122 out of 199 people found this useful


Full Talkback thread

0 comments

Company/Topic Alerts

Create a new alert from the list below:








Featured Talkback

Why do so many (virtually all) software packages think that they are so important that they have to be started automatically every time the computer boots? What is the largest number of "speed access", "update check", "camera download" and whatever other background programs you have ever seen running? Of those, how many did you really need?

By: J.A. Watson

Read full story:
Annoying software: a rogues' gallery

Vista Upgrade Blog

Official MS Windows 7 Bloggers

Check this out: http://blogs.msdn.com/e7...spx Its an official blog "Engineering Windows 7" Nothing. That's what is revealed. Until there is real... More

5 comments

Microsoft's Mojave just a desert vista

It didn't seem fair to wade into Microsoft's “Mojave Experiment” advert quite so soon after the flat earth incident. But The Economist has no such qualms: in this week's issue, it wonders... More

6 comments

... But Still a Few Things Amiss (with...

It's not all roses with Vista, of course. I had my first BSOD over the weekend, when I was turning the laptop back on after suspending it. They typical long blurb about "If this is... More

6 comments