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