#!/usr/bin/expect
set timeout 2
expect_after default {puts stderr "\nFAIL"; exit 1}
spawn /bin/bash
expect "# "
send "login -f foo\r"
expect "$ "
send "exit\r"
exit 0