commit 128a1354159bde3eeeff53eedbd469e5bd0fb2c2
parent d4c9e1926a5bded063225b582540f6851df0d86f
Author: Otto Modinos <ottomodinos@gmail.com>
Date: Sat, 4 Jul 2015 03:14:00 +0300
Use printf instead of echo.
`echo` is [quirky][posix-echo]. Backslashes may (or may not) be expanded
and using `-n` as a password (I hope you don't, but still) could (or
could not) work. `printf` solves all those problems!
Was the ending newline needed?
[posix-echo]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tpm b/tpm
@@ -91,7 +91,8 @@ insert() {
fi
mkdir -p "$(dirname "${entry_path}")"
- echo "${password}" | gpg2 ${GPG_OPTS} --encrypt --output "${entry_path}"
+ printf '%s\n' "${password}" | gpg2 \
+ ${GPG_OPTS} --encrypt --output "${entry_path}"
}
##