Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Wildcard expansion/command line
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: T. Kurt Bond <tkb@t...>
Subject: Re: [Caml-list] Wildcard expansion/command line
Maxence Guesdon writes:
> > So, how does it work? 
> *the shell* expands your unquoted wildcards before passing the args
> to your program.

Not so, strictly speaking.  Under MS Windows the O'Caml runtime
apparently expands wildcards itself, if the shell hasn't already.  (See
byterun/main.c:main() for the call to expand_command_line() and look 
at win32.c for expand_command_line() and its helper functions.)

What did it do under pre-X versions of MacOS?

I think that historically having the shell expand the wildcards for
the program was the *unusual* situation and having the program expand
the wildcards itself was usual.  The "program expands wildcards" has
its advantages (as anybody who has used the VMS command "$ rename
*.COM *.SAV" can attest) but having the shell do it makes most
programs simpler, which is probably why Unix ended up with the shell
doing the work.
T. Kurt Bond,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: