Commit cb85149b85d24c672e5d02cc8c3d93f7d4f22a18

Authored by Georg Hopp
1 parent 780d96d4

exclude ' from characters to ensure they can be used without escaping within single quotes

Showing 1 changed file with 1 additions and 1 deletions
@@ -5,7 +5,7 @@ function rand_printable() { @@ -5,7 +5,7 @@ function rand_printable() {
5 local TR="/usr/bin/tr" 5 local TR="/usr/bin/tr"
6 local HEAD="/usr/bin/head" 6 local HEAD="/usr/bin/head"
7 7
8 - ${ECHO} -n "`</dev/urandom ${TR} -dc \ -~ | ${HEAD} -c${1:-512}`" 8 + ${ECHO} -n "`</dev/urandom ${TR} -dc \ -\&\(-~ | ${HEAD} -c${1:-512}`"
9 } 9 }
10 10
11 test "X$(basename -- "$0")" = "Xrand_printable" && rand_printable "$@" 11 test "X$(basename -- "$0")" = "Xrand_printable" && rand_printable "$@"
Please register or login to post a comment