$${var} 是什么意思?

What does $${var} mean?

以下来自 Makefile 的代码中的 $${spkr} 是什么意思?

for spkr in $(ALLSPKR); do
    mkdir -p mgc/$${spkr}
    for wav in wav/$${spkr}/$(DATASET)_$${spkr}_*.wav; do
        # other stuff
    done
done

这意味着您正在阅读嵌入在 Makefile 中的 shell 脚本。美元符号被 make 用于其自身的变量扩展(例如 $(ALLSPKR)$(DATASET))。这些变量在命令为 运行 之前展开,当命令为 运行 时,双美元符号变为单美元符号,因此 shell 看到 mkdir -p mgc/${spkr}

如果您真的需要 Makefile 中的 shell 脚本中的 PID,您可以 $$$$

它只是一个在 Makefile

中使用的 shell 变量

Using Variables in Recipes