#! for GHC?

Simon Marlow simonmar at microsoft.com
Mon Mar 8 11:25:36 EST 2004

> On Sat, Mar 06 2004, Dean Herington wrote:
> > Can GHC be invoked somehow via the #! mechanism?  Put 
> another way, is 
> > there a GHC analogue to runhugs?
> Well, ghc now has an -e flag to evaluate stuff directly from 
> the prompt 
> (e.g. ghc -e Main.main Main.hs). But you can't execute shell-scripts
> from a shell-script with #! so you can't just put it in your Haskell
> module. Neither can you use the binary directly since you can 
> only give
> one argument to programs executed with #! and you need both -e and -B.

Aha!  I knew there was something else.

However, I just tried it on a recent Linux (RedHat 9) and it seems to
accept nested #! scripts.  There's a rather annoying limit on the length
of the #! line, too.


More information about the Glasgow-haskell-users mailing list