jaedaen

urlencode - encodes $1 as a url

Feb 22nd, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.11 KB | None | 0 0
  1. ENCODED=$(echo -n "$1" | \
  2. perl -pe's/([^-_.~A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg');
  3. echo $ENCODED
Advertisement
Add Comment
Please, Sign In to add comment