Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Sys.getenv does not work under OS X?

8 views
Skip to first unread message

Alan Schmitt

unread,
Sep 11, 2008, 8:52:37 AM9/11/08
to caml...@inria.fr
Hello,

I'm using OS X (Leopard, up to date), with ocaml 3.10.2 (compiled with
godi), and I was trying to use htmlc which fails for some reason. it
boils down to the following:

schmitta@charm compiler % echo $HOST
charm.inrialpes.fr
schmitta@charm compiler % ledit ocaml
Objective Caml version 3.10.2

# Sys.getenv "$HOST";;
Exception: Not_found.
# Sys.getenv "HOST";;
Exception: Not_found.


Is Sys.getenv supposed to work under OS X?

Thanks a lot,

Alan Schmitt

PGP.sig

Christian Sternagel

unread,
Sep 11, 2008, 8:56:37 AM9/11/08
to Alan Schmitt, caml...@inria.fr
Alan Schmitt wrote:
> Hello,
>
> I'm using OS X (Leopard, up to date), with ocaml 3.10.2 (compiled with
> godi), and I was trying to use htmlc which fails for some reason. it
> boils down to the following:
>
> schmitta@charm compiler % echo $HOST
> charm.inrialpes.fr
> schmitta@charm compiler % ledit ocaml
> Objective Caml version 3.10.2
>
> # Sys.getenv "$HOST";;
> Exception: Not_found.
> # Sys.getenv "HOST";;
> Exception: Not_found.
Maybe you ment
Sys.getenv "HOSTNAME"
?

cheers

christian


>
>
> Is Sys.getenv supposed to work under OS X?
>
> Thanks a lot,
>
> Alan Schmitt
>
>

> ------------------------------------------------------------------------
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Nicolas Pouillard

unread,
Sep 11, 2008, 8:59:47 AM9/11/08
to Alan Schmitt, caml-list
Excerpts from Alan Schmitt's message of Thu Sep 11 14:51:06 +0200 2008:

> Hello,
>
> I'm using OS X (Leopard, up to date), with ocaml 3.10.2 (compiled with
> godi), and I was trying to use htmlc which fails for some reason. it
> boils down to the following:
>
> schmitta@charm compiler % echo $HOST
> charm.inrialpes.fr
> schmitta@charm compiler % ledit ocaml
> Objective Caml version 3.10.2
>
> # Sys.getenv "$HOST";;
> Exception: Not_found.

Wrong

> # Sys.getenv "HOST";;
> Exception: Not_found.

Should work

> Is Sys.getenv supposed to work under OS X?

I'm guessing some special thing for HOST, since it work for HOME

--
Nicolas Pouillard aka Ertai

signature.asc

Eric Cooper

unread,
Sep 11, 2008, 10:22:26 AM9/11/08
to caml...@inria.fr
On Thu, Sep 11, 2008 at 02:51:06PM +0200, Alan Schmitt wrote:
> schmitta@charm compiler % echo $HOST
> charm.inrialpes.fr

Are you sure HOST is an environment variable, and not just a variable
that's set in your shell? You can use "printenv HOST" to check.

--
Eric Cooper e c c @ c m u . e d u

Alan Schmitt

unread,
Sep 11, 2008, 10:42:59 AM9/11/08
to caml...@inria.fr
On 11 sept. 08, at 16:22, Eric Cooper wrote:

> On Thu, Sep 11, 2008 at 02:51:06PM +0200, Alan Schmitt wrote:
>> schmitta@charm compiler % echo $HOST
>> charm.inrialpes.fr
>
> Are you sure HOST is an environment variable, and not just a variable
> that's set in your shell? You can use "printenv HOST" to check.

Thanks for all the answers, this is the problem. I don't know what
sets "HOST" but I had to export it to be able to access it.

Thanks again for helping me find the culprit.

Alan Schmitt

PGP.sig
0 new messages