Skip to content

Instantly share code, notes, and snippets.

@ambiorixg12
Created August 12, 2020 21:10
Show Gist options
  • Select an option

  • Save ambiorixg12/bde291ea3c259b5ddc6b796a51e12b77 to your computer and use it in GitHub Desktop.

Select an option

Save ambiorixg12/bde291ea3c259b5ddc6b796a51e12b77 to your computer and use it in GitHub Desktop.
replace and remove
removing particular character from a variable ( remove " )
echo '"18458254937"' | tr -d '"'
https://unix.stackexchange.com/questions/104881/remove-particular-characters-from-a-variable-using-bash
replacing
echo "$string" | tr xyz _
would replace each occurrence of x, y, or z with _, giving A__BC___DEF__LMN in your example
same=>n,Set(pseudodid=${SIP_HEADER(Remote-Party-ID)})
same=>n,Set(from=${SIP_HEADER(FROM)})
same=>n,Set(pseudodid=${CUT(pseudodid,<,1)})
same=>n,Noop(${pseudodid} ${CALLERID(num)})
same=>n,Set(RESULT=${SHELL(echo '${pseudodid}' | tr -d '"')})
same=>n,Set(CALLERID(num)=${RESULT})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment