Obviously you do not want to add your Username/Password to scripts so how can you enter those and make use of execute_cmd and sftp_file without them? Simple provide them as command line arguments in your master script that organizes all Read more…
Sometimes instead of executing a built in command on a remote system you need to upload a script that you will need to execute. Again a simple expect script comes to our rescue to upload a file to a remote Read more…
Often we need to connect to a remote machine and execute a command. If that system is Unix/Linux then with a simple script this becomes very easy to create a command line script to handle this for us:
set user [lindex $argv 0]
set host [lindex $argv 1]
set password [lindex $argv 2]
set packets [lindex $argv 3]
puts "Connecting to $host as $user to install $packets"
spawn ssh $user@$host "$packets"
send -- "$password\r"
Usage: Read more…