Skip to content

Commit

Permalink
moz-sec-get.sh: correctly handle passwords with \
Browse files Browse the repository at this point in the history
dash's echo will parse backslash-number as an octal character code
  • Loading branch information
infinity0 committed Apr 17, 2016
1 parent 5914a19 commit 625774e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moz-sec-get.sh
Expand Up @@ -11,9 +11,9 @@ pass=$( test -n "$2" \
|| secret-tool lookup hostname "$host")

if [ -z "$DISPLAY" ]; then
echo "$pass"
printf "%s\n" "$pass"
else
echo "$pass" | xclip -selection clipboard
printf "%s" "$pass" | xclip -selection clipboard
{ sleep 16; echo "" | xclip -selection clipboard; } &
echo >&2 "copied to clipboard; will clear it after 16s"
fi

0 comments on commit 625774e

Please sign in to comment.