Você não precisa do script de wrapper bash para isso, espera que possa lidar com tudo isso:
#!/usr/bin/expect
set timeout 3
set rootdir /home/user
set sites [file join $rootdir sites.cfg]
set fh [open $sites r]
while {[gets $fh site] != -1} {
set dir [file join $rootdir $site]
if { ! [file isdirectory $dir]} {
puts "*** error: $dir does not exist"
continue
}
cd $dir
puts [pwd]
puts $site
log_file services
spawn ssh -oStrictHostKeyChecking=no -oCheckHostIP=no -oUserKnownHostsFile=/dev/null user@$site
expect "password"
send "mypassword\r
expect "#"
send "environment no more\r"
expect "#"
send "show service service-using\r"
expect "#"
send "logout\r"
expect eof
log_file
}