diff options
author | epochqwert <epoch@hacking.allowed.org> | 2018-04-11 10:57:54 +0000 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2018-04-11 10:57:54 +0000 |
commit | 6827f6b8c2ee147f59642f3e3ebbc96f6164ecdc (patch) | |
tree | f5232726fb8b255b6878afd95403ac84963acda0 /printfurl | |
parent | 97e7c66064d09f242f4a1132f5d372db2f654c51 (diff) | |
download | uritools-6827f6b8c2ee147f59642f3e3ebbc96f6164ecdc.tar.gz uritools-6827f6b8c2ee147f59642f3e3ebbc96f6164ecdc.zip |
fixed printfurl to choke on stuff less often.
Diffstat (limited to 'printfurl')
-rwxr-xr-x | printfurl | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ #!/bin/sh -cutargs="$(printf "%s\n" "$1" | tr '%' '\n' | tail -n+2 | sed 's/^\(.\).*/-\1/g')" -printfargs="$(printf "%s\n" "$1" | sed 's/%./%s/g')" -#printf "printfargs: %s\n" "$printfargs" -cuturl $cutargs | tr '\n' ' ' | xargs -L1 printf "$printfargs" +cutargs="$(printf "%s\n" "$1" | tr '%' '\n' | tail -n+2 | grep '^[sukdPpqfU]' | sed 's/^\(.\).*/-\1/g')" +count="$(echo $cutargs | tr '-' '\n' | grep -c .)" +printfargs="$(printf "%s\n" "$1" | sed 's/%[sukdPpqfU]/%s/g')" +cuturl "$cutargs" | tr '\n' '\0' | xargs -n $count -0 printf "$printfargs" |