newLISP Fan Club

Forum => newLISP in the real world => Topic started by: ale870 on April 30, 2009, 12:19:48 AM

Title: How to make a shell command with newLisp
Post by: ale870 on April 30, 2009, 12:19:48 AM
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!
Title:
Post by: ale870 on April 30, 2009, 12:55:43 AM
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!!!!
Title:
Post by: TedWalther on April 30, 2009, 03:05:36 PM
What does the (! "...") line do?
Title:
Post by: ale870 on April 30, 2009, 03:15:49 PM
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")
Title:
Post by: Lutz on April 30, 2009, 03:23:49 PM
See here:



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



and also here:



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