English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    
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: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Wildcard expansion/command line
Hello,

On Tue, 14 May 2002, Jens Olsson wrote:

> Hello,
> 
> This is my second time at the list. Feel good to be back :) Hope all of you are well! 
> 
> I have a question right away. It might not (probably not) be a Ocaml related question but I'll give it a shot!
> 
> I write a program that is invoked from the command line. All well, but when I was starting to make my program deal with wildcards I realized that the ocaml program gets its command line arguments expanded (if wildcards are used). I have included an exam
ple at the bottom of my mail to clarify if it is unclear what I mean.

[...]
> Example call         Command line arg within my program
> ./myprog m*       -> Sys.argv.(1) = "m1.txt"
> ./myprog m?.txt   -> Sys.argv.(1) = "m1.txt"
> ./myprog "m*"     -> Sys.argv.(1) = "m*"
> 
> ie, wildcards are expanded before given to my program.

This is typical bwehaviour of unix-shells, and that's what
they are good for. That's, why working with shells is so
easy. :)

If you don't want that behaviour, write your own shell, or
let your program explicitly read the arguments in.

Ciao,
   Oliver

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners