Hi Guys,
In Chef Is there any way to call interactive bash shell scripts ? If yes, How ?
I have to automate my environment so in some tasks we are running shell scripts interactively, so how can we achieve this through Chef ?
Hi Guys,
In Chef Is there any way to call interactive bash shell scripts ? If yes, How ?
I have to automate my environment so in some tasks we are running shell scripts interactively, so how can we achieve this through Chef ?
I did it by creating a answer script (./install_bla.sh < answer) or use Autoexpect http://www.admin-magazine.com/Articles/Automating-with-Expect-Scripts
It depends on what responses the scripts expect. If it only expects a “yes” response, the yes program may be all you need:
yes | myscript.sh
If the responses are more complicated, maybe a response file or a HERE document may help:
myscript.sh <<ENDMYSCRIPT
y
response1
response2
ENDMYSCRIPT
If the script doesn’t accept input on stdin but through some other mechanism, you might have to bring out the big guns as Nick suggested.
Kevin Keane
Whom the IT Pros Call
The NetTech
http://www.4nettech.com
Our values: Privacy, Liberty, Justice
See https://www.4nettech.com/corp/the-nettech-values.html