From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA11327; Tue, 14 May 2002 10:24:19 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA11323 for ; Tue, 14 May 2002 10:24:18 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g4E8O6n24230; Tue, 14 May 2002 10:24:06 +0200 (MET DST) Received: from santenay.inria.fr (santenay.inria.fr [128.93.8.59]) by pauillac.inria.fr (8.7.6/8.7.3) with SMTP id KAA11307; Tue, 14 May 2002 10:24:05 +0200 (MET DST) Date: Tue, 14 May 2002 10:24:05 +0200 From: Maxence Guesdon To: "Jens Olsson" Cc: caml-list@inria.fr Subject: Re: [Caml-list] Wildcard expansion/command line Message-Id: <20020514102405.1ff7a399.maxence.guesdon@inria.fr> In-Reply-To: <20020514075059.30862.qmail@operamail.com> References: <20020514075059.30862.qmail@operamail.com> Organization: INRIA X-Mailer: Sylpheed version 0.7.5 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > So, how does it work? *the shell* expands your unquoted wildcards before passing the args to your program. > Example: If a directory has two files m1.txt and m2.txt, and my ocaml program (here called myprog) is invoked with wildcards it would behave something like this: > > 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*" You will have : ./myprog m* -> Sys.argv.(1) = "m1.txt" and Sys.argv.(2) = "m2.txt" ./myprog m?.txt -> Sys.argv.(1) = "m1.txt" and Sys.argv.(2) = "m2.txt" ./myprog "m*" -> Sys.argv.(1) = "m*" since the * is inside quotes Maxence Guesdon ------------------- 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