Re: -mhpattern on NT systems?

2000-12-07 16:21:03
Hi Reini,

CMD.EXE not, and COMMAND.COM neither.
'' is not supported.

" \"..\" " doesn't work as well, which is needed for many perl one-liners
searching for strings.

Therefore I have to use bash.exe or tcsh.exe or use the octal equivalent of ".
best is the latest cygwin bash.

What is cygwin bash?

But forward slashes do work on NT as pathname delimiters.

Yes, but I don't think I can use forward slashes for regex delimiters?

Use an OS with real command-line shells ;^)

This is not OS dependent. bash and tcsh work fine on NT.

I imagine on UNIX you can use -mhpattern '^*.CNM' and it will work.
Trouble is on NT it seems you must use double quotes.

Who knows what the rules are in a Windows Scripting Host?

On the whole, WshShell.Run(strCmd); will run any complex command line
you throw at it, including long file names and file names with spaces.
It also handles redirection and returns an exit code so you can test if
the call succeeded. Unfortunately, the double quotes thing seems to be a

I noticed in MHonArc.BAT the first parameter is in double quotes, but
not the rest, I was wondering if this makes any difference?

Is possible to have it call a wrapper
Perl(?) script that then calls MHonArc with arguments you need?

At present I'm getting round it by calling a new command interpreter.
This seems to allow the double quotes, but it means I loose the return
code from MHonArc.BAT.

Out of interest, does MHonArc have specific return codes, and do they
propogate back to the BAT file? This would be handly when updating
multiple archives on an unattended box as you could bomb out of the loop
upon an error.

that depends how the command is called. normally they spawn a subshell
and garble the args then.

Yes, I'm told WshShell.Run() is a wrapper for the C++ ShellExecuteEx()
Win32 API call, but even after checking out the docs for that, I was no
further forward.

calling perl.exe or via OLE (PerlEz) directly would
help but is not general enough.
e.g. apache requires the correct she-bang path to perl
  #!/usr/bin/perl or #!d:\perl\bin\perl.exe

I'm using ActiveState PERL.

Is it correct that I'm using MHonArc.BAT, or should I maybe be using
MHonArc.PL instead?

Gerry Hickman (London UK)

<Prev in Thread] Current Thread [Next in Thread>