![](https://seccdn.libravatar.org/avatar/d2f7bef0955962945cf8aef4a147f5d1.jpg?s=120&d=mm&r=g)
On 2019/12/11 15:17:41 -0200, Jones De Andrade wrote:
Hi all!
Thanks for all the answers, and really sorry for the delayed answer.
Since my test failed (and led me to misunderstand where the issue resided), I improved it a bit to properly show the failure happening:
************************
~/> which tcsh
/usr/bin/tcsh
~/> ls -l /usr/bin/tcsh lrwxrwxrwx 1 root root 9 mar 19 2018 /usr/bin/tcsh -> /bin/tcsh ~/> sftp -P 2221 android@192.168.0.12 Password authentication Password: Connected to 192.168.0.12. sftp> ls Auto Camera Facebook Google Photos IMG_20171215_152523644-01.jpeg sftp> bye ~/> cat teste.x #!/bin/tcsh
set HOST = "192.168.0.12" ^ ^ set PORT = "2221" ^ ^ set USER = "android" ^ ^ setenv SSHPASS "temporario"
echo $SHELL echo $SSHPASS
sshpass -e sftp -P $PORT $USER@$HOST >& tmp.tmp << EOF ls bye EOF
unsetenv SSHPASS ~/> ./teste.x /bin/bash temporario ~/> ****************************
I see ... afer chmod 755 on the script the string /bin/tcsh temporario and cat tmp.tmp sshpass: Command not found. but I'm a tcsh user and my $SHELL is set to /bin/tcsh at login ... your's seems to be /bin/bash as for the most users. NOTE: The variable is set from your entry in /etc/passwd at login and will NOT be changes by the used shell -- "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr