running SCP as a process

Thierry Douez th.douez at gmail.com
Mon Jan 6 13:08:22 EST 2014


Hi Phil,

Here is a code snippet which accepts a password to
run scp via the LC shell() function.

This code is just a proof of concept (which works)!
Much more can be done and surely much better too.


on mouseUp
   set the shellcommand to "/bin/bash"
   get "expect -c" & quote &cr& \
         "set timeout 1" &cr& \
         "spawn -noecho scp _USER at _HOST:_FILE _LOCALDIR" &cr& \
         "expect password:  { send _PASSWORD\r\n }" &cr& \
         "set timeout 100" &cr& \
         "expect eof" &cr& \
         "sleep 1" &cr& \
         "exit" & quote
   get shell( IT)
   put "shell: " & IT &cr& the result into fld 1
end mouseUp


Regards,

Thierry


2014/1/5 Phil Davis <revdev at pdslabs.net>:
>
> I'm trying to upload a file to a server using scp. It works fine from
> Terminal (Mac), but fails when run as a process in LC.
>
> Any insights you can offer will be greatly appreciated!
>
> Thanks -
>
> --
> Phil Davis


------------------------------------------------
Thierry Douez - http://sunny-tdz.com
Maker of sunnYpdf - sunnYperl - sunnYmidi - sunnYmage




More information about the use-livecode mailing list