In slack you can script slackbot to post messages to a channel like this:
curl --data "$msg" $'https://<yourteam>.slack.com/services/hooks/slackbot?token=<yourtoken>&channel=#random'
Now i'd like to mention a username as the first part of the message like msg="@joernhees hello self"
.
The problem with this is that if the --data
argument of curl starts with an @
sign it will interpret the string after the @
as filename and post its content. Is there a way to make curl ignore the @
sign and to send a literal @
as the first char of a post request?