ojas
ojas

Reputation: 2210

LISP: Run program in Ubuntu

I am newbie in lisp I have installed Clisp in my ubuntu 14.04 machine and SBCL too.

My Program in TextEditor looks like this:

( hello world )

but i am getting the following error:

 user@user:~/Desktop/lisp$ ./test.lisp
    ./test.lisp: line 1: i: command not found

Upvotes: 0

Views: 5478

Answers (2)

Sylwester
Sylwester

Reputation: 48745

With CLISP under a unix (like Ubuntu) you can simply add a shebang to the top of your file #!/path/to/clisp and in Ubuntu that would be #!/usr/bin/clisp and it will execute the code as a script.

You need the file to contain proper Common Lisp file like:

#!/usr/bin/clisp
(princ "Hello, world!")

And make the file executable with chmod 755 <filename>. Unless you have placed it in one of the directories in $PATH you'll need to enter the path to it. From the directory of the file simply ./<filename> would suffice.

Upvotes: 2

Anton Malyshev
Anton Malyshev

Reputation: 8851

You need to run clisp test.lisp

Upvotes: 2

Related Questions