#!/usr/bin/expect -f set timeout 15 spawn ssh -o StrictHostKeyChecking=accept-new $IONOS_HOST expect { "*?assword:*" { $IONOS_SSH" } timeout { puts "Timeout waiting for password prompt" exit 1 } } expect -re {[$#>] } send "find . -maxdepth 4 -name 'wp-content' -type d\r" expect -re {[$#>] } send "exit\r"