EULA接受Bash脚本 [英] EULA Accept Bash Script

查看:38
本文介绍了EULA接受Bash脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个试图安装垃圾桶的脚本.

I have a script that is attempting to install a bin.

一切都正常,除了.bin可打开更多EULA.在脚本再次开始并自行完成安装之前,您必须从其他实例中手动ctrl c.

Everything works fine except that the .bin opens up a EULA in more. You have to manually ctrl c out of this more instance before the script begins again and completes the install on its own.

因为这更多的是逃脱了shell的作用,所以脚本在打开后将不知道要运行什么.有没有一种方法可以期望找到并预防它?

Because this more is escaping the shell the script wont know what to run after its open. Is there a way to get expect to look for this and prevent it?

没有自定义标志可自动接受eula.

There is no custom flags to auto accept the eula.

我到处都在寻找解决方案,但似乎没有任何效果.

Ive looked for solutions everywhere but nothing appears to work.

命令本身很简单,但是在Heredoc之前就被阻塞了

The command itself is simple enough but gets blocked right before the heredoc

/bin/bash gp.bin << AUTO
REST
OF
PARAMETERS
AUTO

推荐答案

您应该可以使用"q"退出更多内容,但这只能以交互方式起作用.

You should be able to use "q" to exit more, but that will only work interactively.

如果安装脚本编写正确,则您可以使用除寻呼机以外的其他功能.试试:

If the install script is written well, you shold be able to use something other than more as your pager. Try:

export PAGER=cat

看看行为是否改变.

如果您仍然遇到问题,则可能需要查看期望之类的内容,而不是heredoc.

If you're still stuck, you might have to look at something like Expect instead of the heredoc.

这篇关于EULA接受Bash脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆