shell() vs terminal re. ssh

Mike Bonner bonnmike at gmail.com
Wed Dec 23 15:39:19 EST 2015


A couple things off the top of my head, the dictionary says it defaults to
/bin/sh rather than /bin/bash  If you aren't doing so, you might specify
/bin/bash with the shellCommand and see if it makes a difference.  In
addition, the environment in shell() doesn't seem to execute the startup
files .profile .bashrc whatever your sys uses.  You might consider using
open process and starting /bin/bash for update feed it the command, and see
if that makes a difference.  If not, you can always feed it commands to
parse the proper files to set up the environment.

source /path/to/.profile

If it works after you 'source.. ' the files you can probably simplify (or
just try it this way to begin with) and string things together in your
shell call to get things set up.  Something like get shell("source
path/to/.profile; path/to/my/other/command.sh")

On Wed, Dec 23, 2015 at 1:26 PM, Richard Gaskin <ambassador at fourthworld.com>
wrote:

> I have a script (copy.sh) on ServerA that uses rsync to copy files to
> ServerB, and I want to call this from a LiveCode CGI.
>
> In Terminal I can log in and execute ./copy.sh, and because I have
> ServerA's ssh public key in ServerB's authorized_keys file it all works
> swimmingly.
>
> But when I call:
>
>   get shell("/path/to/copy.sh")
>
> ...from my CGI, I get:
>
>   Host key verification failed.
>
>
> I'm assuming something about the way the shell function works is
> preventing the ssh key from being found.
>
> I've tried a few different wrapper techniques I've found for forcing
> copy.sh to execute as a specific user, but to no avail.
>
> Any bash experts here to let me know how to resolve this?
>
> TIA -
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  ____________________________________________________________________
>  Ambassador at FourthWorld.com                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list