scripts on unix
Seth Kurtzberg
seth at cql.com
Wed Mar 14 16:58:33 EDT 2007
I compile the programs, instead of trying to run them as scripts. Is there any reason you prefer to interpret the scripts? I'm not saying it's not a legitimate thing to do, just wondering why you prefer to do it that way.
Seth Kurtzberg
On Wed, 14 Mar 2007 19:31:55 +0000
Frederik Eaton <frederik at a5.repetae.net> wrote:
> Hello,
>
> What is the proper technique for creating a Haskell script on a Unix
> system?
>
> e.g. with Perl I do
>
> #!/bin/sh
> echo DEFANGED.348224
> exit
> #!/usr/bin/env perl
> print "hello world\n";
>
> or
>
> #!/usr/bin/perl
> 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'
>
> <interactive>:1:73:
> 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?
>
> Thanks,
>
> Frederik
>
> --
> http://ofb.net/~frederik/
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
More information about the Glasgow-haskell-users
mailing list