From 4684d80b6271dd775cd23dabf2b91d6ce56fa33a Mon Sep 17 00:00:00 2001 From: Ensa Date: Fri, 20 Dec 2019 00:14:09 -0800 Subject: first significant commit see README.md for information --- bin/pw | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/pw (limited to 'bin/pw') diff --git a/bin/pw b/bin/pw new file mode 100755 index 0000000..140f1dc --- /dev/null +++ b/bin/pw @@ -0,0 +1,14 @@ +#!/bin/sh +# generates a password of length $1, sends it to stdout if $2 isn't clip. +# if it is clip, sends it to the X clipboard and clears it after 10 seconds. +if [ "$1" = "-h" ]; then + printf 'usage: %s [-h]|LENGTH [clip]\n' "$(basename $0)">/dev/stderr&&return 1 +fi +PW=$(tr -cd "[:alnum:][:punct:]"