Executing shell commands (OS X)

James Cass cassj at earthlink.net
Mon Jul 5 22:46:26 CDT 2004


Andre -

As an alternative solution, one could use multiple shell commands 
separated by a semi-colon:

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

Cheers...James


On Jul 5, 2004, at 11:01 PM, Andre Garzia wrote:

>
> 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
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list