How do I execute a shell command?

Warren Samples warren at warrensweb.us
Tue Mar 13 12:35:36 EDT 2012


On 03/13/2012 11:29 AM, Bill Vlahos wrote:
> The docs say to execute a shell command you can do:
> shell("ls -l *.txt")
>
> However, this fails for me with:
> Message execution error:
> Error description: Handler: can't find handler
> Hint: shell("ls
>
> How do I run a shell command from inside LiveCode on a Mac?
>
> The full solution I want to do is to run the "id" command as administrator so I could run "sudo id" but I want to prompt for a successful authentication.
>
> I know how to do this in AppleScript so I could just call that but I would rather to it in LC.
>
> Bill Vlahos
>

shell() is a function not a command. From the looks of it, you seem to 
have left off the 'get' or 'put' command to execute the function.

Warren




More information about the use-livecode mailing list