scripts on unix

Frederik Eaton frederik at
Wed Mar 14 15:31:55 EDT 2007


What is the proper technique for creating a Haskell script on a Unix

e.g. with Perl I do

#!/usr/bin/env perl
print "hello world\n";


print "hello world\n";

I tried

$ cat test
#!/usr/bin/env runhaskell
module Main where
main = do
    putStrLn "hello world"

But that doesn't work:

$ ./test
Warning: ignoring unrecognised input `./test'

    Failed to load interface for `Main':
      Use -v to see a list of the files searched for.

When I use "runghc" I get the same error.

If I change the first line to "-x hs" then the error is:

ghc-6.6: unrecognised flags: -x hs
Usage: For basic information, try the `--help' option.

because the #! mechanism only allows a single argument. Thoughts?




More information about the Glasgow-haskell-users mailing list