Executing shell commands (OS X)

Andre Garzia soapdog at mac.com
Mon Jul 5 23:01:45 EDT 2004


On Jul 5, 2004, at 8:41 PM, Sarah Reichelt wrote:

> You don't need to use AppleScript to run Terminal commands in OS X, 
> you can do it directly from Revolution.
> Check out the shellCommand property & shell function. To do what you 
> suggest below, try something like this:
>
> set the shellCommand to "/bin/sh/bash"
> get shell("cd ELS/els-xml")
> get shell("make viewpdf")
>

Sarah,

I don't know if this will work, shell command will execute and return, 
the "cd" command will be lost in the second shell command. I just tried 
this:

get shell("ls")
get shell("cd /etc/")
get shell("ls")

both ls command returned the files in the defaultFolder(), there's no 
persistence of state between shell commands I think. He'd better make a 
bash script inside a field or custom property with what he want to 
execute, then tell the shell() to execute that chunk of text, that way 
he will be certain that the commands are executed in the same 
enviroment...

this will work:
get field "commands to execute in the shell"
get shell(it)

I just tried.

Cheers
Andre


> Doing it this way will not actually involve the Terminal application, 
> so no extra windows will be opened.
>
> Cheers,
> Sarah
>
-- 
Andre Alves Garzia ð 2004
Soap Dog Studios - BRAZIL
http://studio.soapdog.org



More information about the use-livecode mailing list