如何在 Ruby shell 脚本中运行 OS X 命令 say
( man page ),而不退出该脚本?帖子中的建议Calling shell commands from Ruby似乎不适用。
最佳答案
你想要
`say "#{var_name}"`
如果您发现反引号难以阅读
%x(say "#{var_name}")
这也可以工作:
system "say", var_name
关于ruby - 在 Ruby shell 脚本中运行 OS X `say` 命令而不退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26898937/