Reputation: 1
Can someone tell me how to make the variable expand in the following, please:
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'
Upvotes: 0
Views: 531
Reputation: 246807
The single quotes are preventing variable expansion: 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'
# ....................^^........^^
I'm using shell string concatenation there:
Upvotes: 1