> Date: Sat, 05 May 2007 16:16:22 -0400 > From: Nat Goodspeed <[EMAIL PROTECTED]> > Cc: help-emacs-windows@gnu.org > > It's true that new versions of cmd are much more powerful than > ever before. They've tried to adopt many semantic features of the > Bourne shell and its many descendants. The trouble is that rather > than borrowing syntax as well, they've invented some truly astonishing > kludges.
I think they only look kludges because we are accustomed to the Bourne shell syntax. Someone who is used to cmd will probably find the Bourne shell semantics arcane and unintuitive. > I have a small bash script, a helper used by other scripts, that > searches for the base of my current Subversion work area. It writes > the pathname to standard output. Typical usage in a bash script: > cd "$(find-workarea)" > I recently had to write a .bat script (don't ask) in which I > wanted to use the same helper. Yes, it certainly is *possible*. > Here's what I had to write: > for /f "usebackq" %%w in (`bash find-workarea`) do cd %%w I don't know what find-workarea does, but there probably are ways to use the more advanced features of `for /f' for this job without resorting to backticks, if you just dump the Bash script and do it straight in cmd. The primary intent of `for /f' is to parse files, so if find-workarea does anything like that, you shouldn't need to resort to Bash. The upshot of this is that, while cmd is not as powerful as Bash, its latest versions go a long way towards that goal. And the new PowerShell is even more powerful.