#!/bin/sh # generates a password of length $1, sends it to stdout if $2 is blank. # if $2 is clip, sends it to the X clipboard and clears it after 10 seconds. # if $2 is anything else, sends it to the X primary selection and clears it after 10 seconds if [ "$1" = "-h" ]; then printf 'usage: %s [-h]|LENGTH [clip|pri]\n' "$(basename $0)">/dev/stderr return 1 fi PW=$(tr -cd "[:alnum:][:punct:]"