Executing shell commands (OS X)

Sarah Reichelt sarahr at genesearch.com.au
Mon Jul 5 22:43:04 CDT 2004

Thanks for that Andre,
I hadn't actually tried, just assumed it would work :-)
I am usually either doing a single line command, or I build a multiline 
script and execute it in a single shell call, especially when it needs 
a password.

>> 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

More information about the use-livecode mailing list