running SCP as a process
Phil Davis
revdev at pdslabs.net
Mon Jan 6 16:08:06 EST 2014
Thank you Thierry! This is great.
Phil
On 1/6/14, 10:08 AM, Thierry Douez wrote:
> 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
>
> _______________________________________________
> 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
>
--
Phil Davis
More information about the use-livecode
mailing list