I have a script that is attempting to install a bin.
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.
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?
There is no custom flags to auto accept the eula.
Ive looked for solutions everywhere but nothing appears to work.
The command itself is simple enough but gets blocked right before the heredoc
/bin/bash gp.bin << AUTO
REST
OF
PARAMETERS
AUTO
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
And see if the behaviour changes.
If you're still stuck, you might have to look at something like Expect instead of the heredoc.
expect can send Ctrl-C: http://expect.sourceforge.net/FAQ.html#q54
For example:
#!/usr/bin/env expect
spawn "/vendor/install/script.sh"
expect "EULA blah blah blah"
send \003
#rest of expect script...
But try the PAGER environment variable as already suggested.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With