[CM] Mixing scheme script with shell script

Richard Lewis richardlewis at fastmail.co.uk
Fri Sep 19 03:14:34 PDT 2008


On Thursday 18 September 2008 03:12:12 e deleflie wrote:
>
> Does anyone know if it is possible to mix up an SND scheme script
> with normal shell script calls? (including sharing/passing
> parameters between them?)
>
> something like this: (note:tried the below and it doesn't work)
>
> #!/usr/local/bin/snd -b
> !#
> (use-modules (ice-9 format))
> (load "dsp.scm")
> ...
> (exit)
> #!/bin/sh
> echo $HOME
>
The lines beginning #! are called shebang lines and they tell the 
shell which interpreter to invoke to execute the script. At least 
for Bash on my Linux box (and I except the same is true elsewhere), 
it's not possible to have the shell switch interpreters during the 
execution of a script.

One possible solution would be to write one sort of master shell 
script which executes your scheme scripts:

foo.scm:
#!/usr/local/bin/snd -b
(use-modules (ice-9 format))
(load "dsp.scm")

master.sh:
#!/bin/sh
./foo.scm
echo $HOME

Then run master.sh to execute the whole lot.
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard Lewis
JID: ironchicken at jabber.earth.li
http://www.richard-lewis.me.uk/
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+-------------------------------------------------------+
|Please avoid sending me Word or PowerPoint attachments.|
|http://www.gnu.org/philosophy/no-word-attachments.html |
+-------------------------------------------------------+



More information about the Cmdist mailing list