What's the difference between LC 'shell' and OSX terminal?

Graham Samuel livfoss at mac.com
Sat Oct 29 10:40:53 EDT 2011


Thanks to all who replied.

Just a brief reminder that I found I could invoke ImageMagick from Terminal on my Mac, but not via 'shell' within an LC program on the same machine.

I really hoped that Andre's insight was right and that it was a path issue - really because I understand what one of those is! Anyway on your advice, Andre, I did:

  which convert

in Terminal, and got:

  /opt/local/bin/convert

I don't exactly know what 'opt' is, but I can open /opt/local/bin/ in the Mac Finder, so it exists OK, and it contains a file 'convert' as expected. Anyway I tried doing this in the LS message box:

   shell(/opt/local/bin/convert)

and got:

Message execution error:
Error description: Handler: can't find handler
Hint: shell(/opt/local/bin/convert)

I then set the defaultFolder to   /opt/local/bin/, and the Message Box couldn't even recognise 'shell'!

So very sadly, that didn't work. Neither did it work when I put the whole shell argument in quotes, nor could shell find other commands such as 'which' or 'cd' with or without the path data.

Andre's solution seems so logical… any more suggestions? Incidentally, on my machine shellCommand is set to:

  /bin/sh

which AFAIK is what it's supposed to be.

TIA

Graham

Thanks also to Mike Bonner for his advice on command lines (some of which I understood, although I'd never heard of a profile in the sense Mike uses, so I am a bit at sea there). Also, although currently I'm just experimenting, I'm always looking for solutions which would work in a complete cross-platform app built for people who just want to use the computer as a tool. In that context any 'tinkering' with the environment would have to be done via LS, and within that via shell, so as to protect my user - I'm not sure if this is possible or not, but I'll keep trying to understand it. In my encounters with ImageMagick the really interesting thing I've learned so far is the philosophical difference between 'nix users and Mac/PC users - it's geeks versus consumers really. I was once a geek myself, in some pretty tough technical environments, but the reason I use LS is because I stopped being one.






More information about the use-livecode mailing list