[racket] Help: Running racket programs from command line

From: A Z (ukbc57 at gmail.com)
Date: Mon Sep 27 18:35:01 EDT 2010

Hello Horace,

I thank you for patiently explaining me how to run racket from command line.

Actually, this is not exactly what I am looking for.

What I want is a script file. Such that I can test the modules of the
program from command prompt.

Something like

*******
#!/bin/bash
racket -f "file.rkt"

racket (twice 2)
*******

Thanks in advance,
Colum


On Mon, Sep 27, 2010 at 4:39 PM, Horace Dynamite
<horace.dynamite at gmail.com>wrote:

> > Say, the racket file is file.rkt
> >
> > ***********
> > (define (twice x)
> >         (* 2 x))
> >
> > and so on....
> >
> > **********
> >
> > I want to test if (twice 2) is 4 from the command line.
>
> You need to know what "folder" or "directory" you saved the file in.
> Lets say it's in C:\racket\
>
> Click Start -> Run and type "cmd" (without the quotes)
> Then type (again, without quotes)
> "cd C:\racket\"
>
> (or you could pass the full path to enter! (see below) instead)
>
> If the racket executable is in your path, you should be able to type
> "racket.exe" and have the racket program waiting for your input. If
> this is not the case, you need to find out where your racket
> executable is. Try "C:\program files\Racket\racket.exe".
>
> If that doesn't work, hunt through you're program files folder to see
> where you installed Racket.
>
> Once the racket program is waiting on your input, type "(enter!
> "file.rkt")" and you should be all set, then you may type "(twice 2)"
> and see the result.
>
> This will only work if you "cd"'d into the correct folder above.
>
> More experienced users have made running racket from the "command
> line" like this more convenient by setting up their favourite editor
> to automatically launch the racket program, and to make sure it's in
> the folder their racket files are located.
>
> If this all sounds too complicated (it does to me), I'd strongly
> suggest you use DrRacket.
>
> Hope that helps,
>
> Horace.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100927/235d781f/attachment.html>

Posted on the users mailing list.