How to make a shell command with newLisp

Started by ale870, April 30, 2009, 12:19:48 AM

Previous topic - Next topic

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:


#!/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!
--

ale870

#1
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!!!!
--

TedWalther

#2
What does the (! "...") line do?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

ale870

#3
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")
--

Lutz

#4
See here:



http://www.newlisp.org/newlisp_manual.html#shell">http://www.newlisp.org/newlisp_manual.html#shell



and also here:



http://www.newlisp.org/newlisp_manual.html#exec">http://www.newlisp.org/newlisp_manual.html#exec