shell 交互式问答式自动化脚本spawn和expect

/usr/bin/expect < spawn vue init webpack test-study-pro
expect “Project name (test-study-pro)”
send “\r\n”
expect “Project description (A Vue.js project)”
send “\r\n”
expect “Author”
send “\r”
expect “.Runtime + Compiler: recommended for most users*”
send “\r”
expect “Install vue-router? (Y/n)”
send “y\r”
expect “Use ESLint to lint your code? (Y/n)”
send “y\r”
expect “.Standard (https://github.com/standard/standard)*”
send “\r”
expect “Set up unit tests (Y/n)”
send “n\r”
expect “Setup e2e tests with Nightwatch? (Y/n)”
send “n\r”
expect “Yes, use NPM”
send “\r”
expect eof
EOF

你可能感兴趣的:(linux)