Every format with its parser

To copy and paste: echo ‘{“channel”:”main”,”text”:”Hello %%USER%%”}’ > message.json
Every format with its parser
To copy and paste: data=$( jq -n \ — arg SLACK_CHANNEL “${SLACK_CHANNEL}” \ — arg text “Hello ${USER}.” \ ‘{channel:$SLACK_CHANNEL,text:$text}’ ) curl -X POST \ -H “Authorization: Bearer $SLACK_AUTHORIZATION” \ -H ‘Content-type: application/json; charset=utf-8’ \ — data “$data” \ https://slack.com/api/chat.postMessage

Explanation:

The -n parameter in jq allows you to create a new object from scratch without taking any input to parse.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Teracloud

Teracloud

113 Followers

All the important news about Cloud Computing. Let´s stay connected to the future