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 OAA17849; Fri, 19 Apr 2002 14:17:10 +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 OAA17845 for ; Fri, 19 Apr 2002 14:17:08 +0200 (MET DST) Received: from grisu.bik-gmbh.de (grisu.bik-gmbh.de [194.233.237.82]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3JCH7L11456 for ; Fri, 19 Apr 2002 14:17:07 +0200 (MET DST) Received: from prony.bik-gmbh.de (prony.bik-gmbh.de [194.233.237.133]) by grisu.bik-gmbh.de (8.11.3/8.11.1) with ESMTP id g3JCDdo25997; Fri, 19 Apr 2002 14:13:39 +0200 (CEST) (envelope-from hars@bik-gmbh.de) Received: from hars by prony.bik-gmbh.de with local (Exim 3.33 #1 (Debian)) id 16yXOi-0008D3-00; Fri, 19 Apr 2002 14:21:52 +0200 Date: Fri, 19 Apr 2002 14:21:51 +0200 From: Florian Hars To: Jacques Garrigue Cc: rbw3@cet.nau.edu, caml-list@inria.fr Subject: Re: [Caml-list] command arguments sticking together Message-ID: <20020419122151.GA31540@bik-gmbh.de> References: <"fromAndrej.Bauer"@andrej.com> <20020419055857.E12446@deathonastick.org> <20020419182233V.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20020419182233V.garrigue@kurims.kyoto-u.ac.jp> User-Agent: Mutt/1.3.24i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk begin Jacques Garrigue quote: > > #!/myscript option1 option2 ... > > > > The problem is that I am using the included Arg module to parse the arguments, > > but when myscript is called it only sees one argument consisting of all the > > arguments stuffed together... which the Arg routines don't care for much. > > Could you explain a bit more what is your problem? His problem is that he is using Unix or a shell that behaves as a Unix-shell: If the program is a file beginning with #!, the remainder of the first line specifies an interpreter for the pro­ gram. The shell executes the specified interpreter on operating systems that do not handle this executable for­ mat themselves. The arguments to the interpreter consist ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ of a single optional argument following the interpreter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ name on the first line of the program, followed by the ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ name of the program, followed by the command arguments, if any. This is from the bash man page, but other shells should do the same thing, and it is the normal behaviour for #!-scripts under Unix. Yours, Florian. ------------------- 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