pass.sh
------------------------
#!/bin/bash
echo start
/usr/bin/expect <<EOF
set timeout 10
spawn sudo su
expect "password for wadi:"
send "1
"
expect "*#"
send "cd ~
"
expect "*#"
send "/home/wadi/shell/passwd/shell.sh
"
expect "*#"
send "exit
"
interact
EOF
echo "
"
whoami
echo end
----------------------
shell.sh
#!/bin/bash
echo "yes"