inux read命令默认是读取键盘的输入,在makefile中使用这条命令可以暂停makefile的执行,按下键盘任意键又可以继续运行makeifle 。通过这个办法可以调试makefile的编写和阅读。用read命令暂停makefile的执行
例如 在 你需要 暂停的地方加上read 命令 ,就可以调试makefile 的执行状态,以便分析问题,后续只要按回车键就又可以继续了执行
/bin/bash 下 直接用 read 即可
而 /bin/sh ,
read a // read 要带上参数 ,否则 报错 read: arg count
参考 :
https://blog.csdn.net/micro9981/article/details/82187435