0
I am treating the CURL return with SED, but as the information I receive but sometimes has the character / causes an error in the SED syntax.
TOKEN=$(curl --silent $URL | awk -F '"' '/content/ {print $2}')
echo $TOKEN
2CTVaTm46Uoregv0VcU2QPd15B3G/Opngx7iavl9cns=
sed -e "s/@TOKEN/$TOKEN/" $JSON_FILE > /tmp/$NAME.json
sed: -e Expression #1, char 39: Unknown option to `s'
How can I specify for SED that when there is / in the substitution variable it should not interpret as command?
Use another character, for example
;
instead of the bar. Ex:sed -e "s;@TOKEN;$TOKEN;"
– Valdeir Psr
I didn’t know I could use another character as a separator, so I decided because in return there is no ; Thanks
– fdavid