From f42437388d113d3fe984384953faeae98d673304 Mon Sep 17 00:00:00 2001 From: drduh Date: Tue, 4 Aug 2015 22:48:09 -0400 Subject: [PATCH] Add option to suppress password output. Update README to mention this feature and Alternative projects. --- README.md | 13 +++++++++---- pwd.sh | 5 ++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9ca93e2..2e0ace2 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,13 @@ Type `r` to read a password(s). Type `d` to delete a password. -Options can also be passed on the command line, e.g., +Options can also be passed on the command line. Here are some examples: -`./pwd.sh w gmail 30` to generate and write a password called 'gmail' with a length of 30 characters, or +`./pwd.sh w gmail 30` to create a password for 'gmail' with a length of 30 characters. Append `q` to suppress password output. -`./pwd.sh r github` to read the password called 'github', or +`./pwd.sh r user@github` to read the password for 'user@github'. -`./pwd.sh d dropbox` to delete the password called 'dropbox'. +`./pwd.sh d dropbox` to delete the password for 'dropbox'. Combine with other programs by piping output, e.g., @@ -35,3 +35,8 @@ Combine with other programs by piping output, e.g., The script and `pwd.sh.safe` encrypted file can be safely shared between machines over public channels (Google Drive, Dropbox, etc). A sample `gpg.conf` configuration file is provided for your consideration. + +# Alternatives + +[Pass: the standard unix password manager](http://www.passwordstore.org/) + diff --git a/pwd.sh b/pwd.sh index 3086194..27a5775 100755 --- a/pwd.sh +++ b/pwd.sh @@ -164,7 +164,10 @@ create_username () { userpass=$password else userpass=$(gen_pass "$@") - echo " + fi + + if [[ -z "${4+x}" || ! "${4}" =~ ^([qQ])$ ]] ; then + echo " Password: ${userpass}" fi }