Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- usage () {
- echo "Usage: $( basename $0 ) <e|d> <string>"
- }
- if [ "$#" -lt 2 ]; then
- usage
- exit 1
- fi
- if [ "$1" = "e" ]; then
- echo "$2" | ruby -ruri -ne 'puts URI.encode($_.chomp)'
- elif [ "$1" = "d" ]; then
- echo "$2" | ruby -ruri -ne 'puts URI.decode($_.chomp)'
- else
- usage
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement