1 2 3 4 5 6 7
#!/bin/sh if [ "_$1" != "_" ];then l="$1" else read l fi printf "$(echo "$l" | sed "s/%/\\\\x/g")"