#!/bin/bash
/data/data/com.magicandroidapps.bettertermpro/bin/ssh -i /data/data/com.magicandroidapps.bettertermpro/home/.ssh/identity -l user 192.168.1.180
FILE_CONTENT=`/data/data/com.magicandroidapps.bettertermpro/bin/ssh -i /data/data/com.magicandroidapps.bettertermpro/home/.ssh/identity -l user 192.168.1.180 "cat /tmp/file/"`
> I assume my problem is that the environment is different when using
> Tasker's shell task as opposed to BTEP's
> Thats why ssh binary cannot find its known_hosts file where accepted
> keys reside.
> It works in BTEP's , but not in Tasker.
I betcha! Go into any console, type "env" or "echo $HOME". Chances are ssh and many other unix type commands that have business with a users private files use the environment variable $HOME to find them.
Set "export HOME='directory-of-my-stuff'" before using ssh. Should work with busybox' "ash" and all Bourne shells.
+clemens
> this is a combination of something I had and something in my head so I
> have
> no idea if it works :)
>
> FILE_CONTENT=`/data/data/com.magicandroidapps.bettertermpro/bin/ssh -i
>
> > /data/data/com.magicandroidapps.bettertermpro/home/.ssh/identity -l
> user
> > 192.168.1.180 "cat /tmp/file/"`
>
>
> this should execute the cat command over ssh and store the result in
> FILE_CONTENT
> now to find a way to get that in Tasker..
... which might cause trouble.
- it only works for short files, because there's a limit on how much can be stored in a shell variable.
- using the variable will cause the shell to break its value on white space, expand '$any-letters' combinations etc. depending on weather it's quoted and how.
If the object is to be used as a file, store it in a file.
+clemens
echo $PATH
from both secure settings and tasker, to see if there are any significant shell env differences?
Tom