caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brock <awwaiid@deathonastick.org>
To: Christopher Quinn <cq@htec.demon.co.uk>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] command arguments sticking together
Date: Fri, 19 Apr 2002 19:39:47 +0000	[thread overview]
Message-ID: <20020419193947.A1565@deathonastick.org> (raw)
In-Reply-To: <"from cq"@htec.demon.co.uk>

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


  parent reply	other threads:[~2002-04-20 10:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-14 18:03 [Caml-list] Filename.quote - again Vitaly Lugovsky
2002-04-15  8:12 ` [Caml-list] " Xavier Leroy
2002-04-15 12:49   ` Vitaly Lugovsky
2002-04-15 13:26     ` Andrej Bauer
2002-04-15 13:47       ` Vitaly Lugovsky
     [not found]       ` <"from Andrej.Bauer"@andrej.com>
2002-04-19  5:58         ` [Caml-list] command arguments sticking together Brock
2002-04-19  9:08           ` Jérôme Marant
2002-04-19 10:01             ` [Caml-list] Prerelease - Announce ocaml-swig Benedikt Grundmann
2002-04-19  9:22           ` [Caml-list] command arguments sticking together Jacques Garrigue
2002-04-19 12:21             ` Florian Hars
2002-04-19 13:01               ` Christopher Quinn
2002-04-19 13:33                 ` Christopher Quinn
     [not found]                   ` <"from cq"@htec.demon.co.uk>
2002-04-19 19:39                     ` Brock [this message]
2002-04-20 11:09                       ` Alain Frisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020419193947.A1565@deathonastick.org \
    --to=awwaiid@deathonastick.org \
    --cc=caml-list@inria.fr \
    --cc=cq@htec.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).