1

In the installation of my system, it compiles a module called php ssh2, which asks to select a patch (as shown on the picture in red).

It does not need a patch, so you don't have to do anything other than just press Enter.

I just need it to press Enter to continue the build - Is there some way for me to do this in shell script / to remove this confirmation, to make press Enter automatically?

enter image description here

udondan
  • 57,263
  • 20
  • 190
  • 175
Filipi Silva
  • 137
  • 1
  • 1
  • 10
  • set the command line options? – Karoly Horvath Jan 27 '14 at 17:32
  • Please tell us more about your installation system. What operating system, and what installation system? – Gustav Bertram Jan 28 '14 at 08:43
  • Maybe you could use a timer..lets say for 5 sec and if no key pressed move to next instruction. Have a look at http://stackoverflow.com/questions/9483633/press-enter-or-wait-10seconds-to-continue. – neo Jan 28 '14 at 08:50

2 Answers2

1

Assume your php ssh2 script is called myprogram, then you can do this

echo -ne '\n' | ./myprogram

\n will simulate the enter

hashbrown
  • 3,438
  • 1
  • 19
  • 37
1

As a non elegant but working solution I have found that in some cases the only way to script the ENTER was redirecting a file with that only char on it. Similar to previous solution:

cat enter.txt | ./myprogram

To create de file just do:

vi enter.txt
<press i>
<press ENTER>
<press ESCAPE>
:wq
jordi
  • 1,157
  • 1
  • 13
  • 37