Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Filename.quote - again
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brock <awwaiid@d...>
Subject: Re: [Caml-list] command arguments sticking together
This is getting close to what I need, and indeed solves the
multiple-arguments-stuck-into-a-single-argument problem. What I'm trying to do
is take the program mhtml (which is written in caml) and allow it to be used as
a script interpreter for MacroHTML. The body of such a script could be
something as simple as:

#!/usr/bin/mhtml -I /path/to/include/files
<h1>Hello!</h1>

And the idea is that the body of the script should be passed to mhtml through
stdin, just like with the other interpreters. The problem I'm having with the
suggested solution is that mhtml is not getting the rest of the file through
stdin like I expect it to. I tried to do this:

#!/bin/sh
exec mhtml arg1 arg2 arg3 ...
data...

but mhtml is not getting the data, instead mhtml is trying to get input from
the real stdin. I tried to make a sort of wrapper script but have been
unsuccesfull so far... the wrapper looked like this:

#!/bin/sh
exec mhtml $@

And then the body of the .mhtml file I want interpreted would look like:
#!/path/to/wrapper -I /path/to/include/files
<h1>hello</h1>

But then I get the shell trying to interpret the data part (the html stuff) of
the file! Any tips would be appreciated. Possibly a better solution would be to
get ocaml to parse the arguments even if they are all stuck together?

--Brock

On 2002.04.19.14.33, Christopher Quinn wrote:
|What I meant is actually:
|
|#!/bin/sh
|# (*
|exec myscript a b c ....
|*)
|caml code...
...
-------------------
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