提示时如何在Shell脚本中自动填充用户名和密码

时间:2019-12-09 19:35:22

标签: shell

我想在脚本提示时添加自动填充用户名和密码。

在这里,我想填写已经可变的用户名和密码。

这是我的剧本,请帮帮我。

#!/bin/sh

my_user_id = "my_user_id"
my_password = "my_password"
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition

expect "Username:"
send "$my_user_id"
expect "Password:"
send "$my_password"

我想自动化我的脚本。

0 个答案:

没有答案