#! /usr/bin/expect

#发送命令

spawn mkfs.ocfs2 -N 6 /dev/sdc -F  

#匹配命令

expect {
"*(y/N):*"
  #匹配后再发送命令

   { send "y\r" }
}

interact

Logo

更多推荐