Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Command line globbing under Win32

by Jenda (Abbot)
on Jul 10, 2002 at 16:29 UTC ( [id://180784]=perlquestion: print w/replies, xml ) Need Help??

Jenda has asked for the wisdom of the Perl Monks concerning the following question:

I know cmd.exe and command.com do not do the command line globbing (pass the process the filemask instead of a list of files that match it), I know what to do with it (see my G.pm module.)

What I would like to know is what other shells do not do the globbing? I'd think 4NT doesn't do it, what others? What exactly will be in $ENV{COMSPEC} if you use that shell?

The reason I am asking is that I would like the G.pm to know whether the globbing was already done by the shell or not. Of course this can never be 100%, but anyway.

  Jenda

P.S.: I'd like to ask the Unixers to ignore this question. I do not want any "Unix vs. Windows" flame war. I only want responses from Windozers that use (or know of) something else than cmd.exe or command.com. Thanks.

Replies are listed 'Best First'.
Re: Command line globbing under Win32
by jdavidboyd (Friar) on Jul 10, 2002 at 16:59 UTC
    I'm fairly certain that 4NT does NO command line globbing at all
    The help section states that the 4dos command line is first 4nt alias expanded, then 4nt variable expanded, then the command line is checked for redirection or piping.

    The following snip shows what is in my comspec variable running under 4nt.

    c:\ ->perl -e "print \"$ENV{COMSPEC}\""
    C:\4NT\4NT.EXE

      Thank you

      I have just uploaded a beta version of new G.pm to http://jenda.krynicky.cz/Beta/ and would like to ask people to try it out.

      Changes from last version:

      • The module no longer uses Win32::API. Under Windows it uses an XS part to get to the raw command line, on other systems it is just plain Perl using no modules except core ones.
      • The module now not only tweaks @ARGV if asked to, but also exports the functions containing its functionality. These functions work fine on non-Windows systems as well, except for GetCommandLine() with is replaced by a stub.
      • If the module is loaded due to "use G" statement it only does anything under Windows. If it's loaded by -MG in perl parameters or PERL5OPT it globs the params even under Unix. This may be handy if you need to start another script, need to glob the parameters and do not want to include shell in the process for security reasons.

      Please let me know if you have any problems or if something works unlike you expect.

      Thanks, Jenda

      P.S.: If you use Windows & ActivePerl 6xx you may install the module by
      ppm install --location=http://jenda.krynicky.cz/Beta G

      Update: May I ask why did people downvote this node? I really wish I could see the list of people who downvoted a node so that I could ask them why.

      P.P.S.: It's no longer beta. Install by
      ppm install --location=http://jenda.krynicky.cz/perl G

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://180784]
Approved by Rex(Wrecks)
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-19 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found