Answer the question
In order to leave comments, you need to log in
How to modify sh?
There are two file test and ssh_connect
In test file I call gnome-terminal -e ./ssh_connect and pass variable $domain
In ssh_connect contains
#!/usr/bin/expect
source ./test
eval spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no [email protected]$domain
#use correct prompt
set prompt ":|#|\\\$"
interact -o -nobuffer -re $prompt return
send "PASS\r"
interact -o -nobuffer -re $prompt return
send "cd\r"
interact
Answer the question
In order to leave comments, you need to log in
Here is the solution to the problem!
gnome-terminal -x bash -i -c "./ssh_connect %d %f; read"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question