Page 1 of 1

How to make a shell command with newLisp

Posted: Thu Apr 30, 2009 7:19 am
by ale870
Hello,

I need to make a small script to map my samba drives. I wanted to make it using newLisp instead using typical shell commands (like #!/bin/bash).

I tried this, but I cannot make it executable:

Code: Select all

#!/usr/bin/newlisp

(writeln "Drive MyWindowsC...")
(! "mount MOUNT_SMB/MyWindowsC")

Please consider that the MOUNT command works perfectly.
I have Linux Mint 6 and XFCE. I (try) to execute the command as:

sudo ./mount_drives

I obtain:

ERR: invalid function : (writeln "Drive MyWindowsC...")

It seems it does not recognize newlisp as my shell interpreter.

Can you help me?

Thank you!

Posted: Thu Apr 30, 2009 7:55 am
by ale870
OH MY GOD! I made a mistake (too many programming languages in my head!)

(writeln) does not exist! It is (println)!!!!!!!!!!!!!!!!!

I'm sorry.

Topic solved!!!!

Posted: Thu Apr 30, 2009 10:05 pm
by TedWalther
What does the (! "...") line do?

Posted: Thu Apr 30, 2009 10:15 pm
by ale870
It executes an external command, like "ls" or recall a program like a text editor.
Try this in your command shell:

WINDOWS:

>> (! "dir")

LINUX

>> (! "ls")

Posted: Thu Apr 30, 2009 10:23 pm
by Lutz