From 47eb00790cfe9badb8f08d4f3e7e3241f1f1649f Mon Sep 17 00:00:00 2001 From: epochqwert Date: Thu, 12 Apr 2018 10:48:08 +0000 Subject: better format string cutting in printfurl and start now single-quote escapes the url before sending it to printf url --- printfurl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'printfurl') diff --git a/printfurl b/printfurl index 91fd388..c141bc1 100755 --- a/printfurl +++ b/printfurl @@ -1,5 +1,5 @@ #!/bin/sh -cutargs="$(printf "%s\n" "$1" | tr '%' '\n' | tail -n+2 | grep '^[sukdPpqfU]' | sed 's/^\(.\).*/-\1/g')" +cutargs="$(printf "%s\n" "$1" | sed 's/%[^sukdPpqfU]//g' | tr '%' '\n' | tail -n+2 | sed 's/^\(.\).*/-\1/g' | tr '\n' ' ')" 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" -- cgit v1.2.3