Here’s my code:
curl -u "u:d" --data-urlencode "status=`echo $@|tr ' ' '+'|tr '&' '%26'`" "http://twitter.com/statuses/update.json"
But when it goes to twitter, the ‘&’ turns into ‘%’. What am I doing wrong? Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
trperforms individual character replacement.It replaces
&with%because that’s what you told it to do.You want something like
sedwhich does more than just character-by-character substitution.