有没有人能告诉我如何让变量在下面展开:
MESSAGE="Public IP Address has changed"
osascript -e 'tell application (path to frontmost application as text) to display \
dialog "My message is ${MESSAGE} " buttons {"OK"} with icon stop'发布于 2018-06-19 01:07:56
单引号阻止了变量扩展:3.1.2.2 Single Quotes
MESSAGE="Public IP Address has changed"
osascript -e 'tell application (path to frontmost application as text) to display \
dialog "My message is '"$MESSAGE"' " buttons {"OK"} with icon stop'
# ....................^^........^^我在这里使用shell字符串连接:
https://stackoverflow.com/questions/50914015
复制相似问题