Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I pause to inspect results of sh commands run by a Makefile?

So, I have a Makefile which runs different commands of how to build S/W. I execute make from within a MSYS / MinGW enviroment.

I found for example, the sleep <seconds> command, but this only delays the execution. How can I make it wait for a key being pressed, for example?

like image 328
citn Avatar asked Oct 16 '25 21:10

citn


2 Answers

You can use the read command. When you are done you press enter and your script/makefile continues. It's a builtin bash command, so it should work also on MinGW.

like image 86
Federico klez Culloca Avatar answered Oct 19 '25 11:10

Federico klez Culloca


My proposition doesn't stop execution but halts and resume display on capable terminals:

Use ctrl-S for halting display, and ctrl-Q for resuming.

You don't need to modify your Makefile.

like image 33
mouviciel Avatar answered Oct 19 '25 11:10

mouviciel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!