Skip to content

Instantly share code, notes, and snippets.

@navicore
Created November 12, 2016 15:56
Show Gist options
  • Select an option

  • Save navicore/770dc3f4bf99fbeb517fa7713a844cca to your computer and use it in GitHub Desktop.

Select an option

Save navicore/770dc3f4bf99fbeb517fa7713a844cca to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
exec 3>&1
exec 1>&2
set -x
ATC_HOME="https://some.com/mydir"
payload=$(mktemp /tmp/resource-in.XXXXXX)
cat > "${payload}" <&0
text="$(jq -r '.params.text' < "${payload}")"
# escape ( and )
text="${text//\(/\\(}"
text="${text//\)/\\)}"
text=`eval echo $text`
echo "final text: $text"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment