
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. Cheers, Simon

On Mon, Mar 08 2004, Simon Marlow wrote:
However, I just tried it on a recent Linux (RedHat 9) and it seems to accept nested #! scripts.
It doesn't work for me though (it tries to run the first script (the Haskell module) with the interpreter for the second script (bash). Anyway, one cannot expect it to work for everyone (esp. since shells differ and OS:es too). However it should be quite simple to include a program similar to the attached one to provide "runhugs" capability. /Hampus -- Homepage: http://www.dtek.chalmers.se/~d00ram E-mail: d00ram@dtek.chalmers.se "Det är aldrig försent att ge upp"
participants (2)
-
Hampus Ram
-
Simon Marlow