#!/usr/bin/expect -f set timeout -1 spawn /opt/e2fsprogs/sbin/e2fsck -v $argv expect { "Clear? " { send "y" ; exp_continue } "Abort? " { send "n" ; exp_continue } "Recreate? " { send "y" ; exp_continue } "Fix? " { send "y" ; exp_continue } "Ignore error? " { send "y" ; exp_continue } "Force rewrite? " { send "y" ; exp_continue } }