diff options
-rw-r--r-- | .functions | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -103,19 +103,28 @@ function digga() { # Escape UTF-8 characters into their 3-byte format function escape() { printf "\\\x%s" $(printf "$@" | xxd -p -c1 -u) - echo # newline + # print a newline unless we’re piping the output to another program + if [ -t 1 ]; then + echo # newline + fi } # Decode \x{ABCD}-style Unicode escape sequences function unidecode() { perl -e "binmode(STDOUT, ':utf8'); print \"$@\"" - echo # newline + # print a newline unless we’re piping the output to another program + if [ -t 1 ]; then + echo # newline + fi } # Get a character’s Unicode code point function codepoint() { perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))" - echo # newline + # print a newline unless we’re piping the output to another program + if [ -t 1 ]; then + echo # newline + fi } # Show all the names (CNs and SANs) listed in the SSL certificate |