[p4] encapsulation of third party software
Weintraub, David
david.weintraub at bofasecurities.com
Wed Oct 4 06:55:13 PDT 2006
I've been writing Windows and DOS shell scripts for years, and I'll be
the first to tell you that the Windows shell is not anywhere as powerful
as the Unix shell. The biggest difference is shell expansion in Unix
which doesn't even exist in the Windows shell (actually, it does exist,
but in a typical PC irony, not in the shell itself. Individual programs
must "turn on" shell expansion, but CMD.exe doesn't). Looping is very
limited and pretty much undocumented. There is a new for expansion
syntax that most people don't even realize exists, but again, it is weak
compared to the Unix shell.
There is historic reasons for this. The original DOS shell was not
designed to be a Unix shell copy. Instead, MS-DOS was based upon QDOS
(Quick and Dirty OS) that was written by Seattle Computer. QDOS was
written in a couple of days to provide a new foundation services for
programming the new 16 bit Intel chips. Much of QDOS was taken from CP/M
which was based upon other single chip CPU based computers that were
coming up from the computer hobby scene. These shells were quickly
thrown together and were designed to take up as few resources as
possible. They were suppose to do their job, and get out of the way in
order not to hog the 4 to 8K of memory these machines were using at the
time.
Before 1974, Unix and Multix shells were very PC like. Their main job
was to provide basic services and get out of the way. This all changed
when Steve Bourne came up with a new concept for the shell. Steve Bourne
redesigned the shell to be the "glue" for the Unix system. In Steve
Bourne's mind, Unix utilities would perform only a very limited tasks,
but they would be able to pass these tasks to other Unix processes. In
order for the various Unix programs to efficiently pass their results
from one program to another, Steve Bourne had to come up with a full
feature shell language, efficient piping, and redirections. After all,
minicomputer Unix systems had gobs of memory compared to their hobby
computer counterparts. The shell simply could do a lot more.
I highly recommend that anyone who wants the power of the Unix utilities
and shell on their PC to download Cygwin (http://cygwin.com/) which is a
freeware Unix environment for Windows. Cygwin provides all the standard
Unix utilities, shells, and even an XClient which I think works better
than Hummingbird. There is even a Cygwin P4 client. How can you beat
that?
-----Original Message-----
From: Smith, Jeff [mailto:jsmith at medplus.com]
Sent: Wednesday, October 04, 2006 8:54 AM
To: Jeremy Russell; Weintraub, David; Monica Sanchez;
perforce-user at perforce.com
Subject: RE: [p4] encapsulation of third party software
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Jeremy Russell
Sent: Tuesday, October 03, 2006 11:54 PM
>The framework principals are in Windows as well, but with a really,
horrible, terrible,
>really bad command line (you can't even call it a shell).
Gotta disagree with you here. It's not great but it's not that bad.
You can do nearly everything in the Windows shell that you can with a
UNIX shell although many of the things are not intuitive. And there are
a few things that are undocumented that you may not realize are there
(sh redirection semantics for instance). You can also do if/else,
subroutines, backquoting of commands to capture output and more. It
even has some parsing functionality that the UNIX shells typically push
off on other programs like sed/awk/basename.
In the end, I usually find that if I can't do it in the Windows shell I
probably ought to be use Perl or Python.
Jeff
More information about the perforce-user
mailing list