From 020b9dc7d4a833378c8e2bc36a1bec20efeaa696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 18 Nov 2017 21:42:03 +0100 Subject: [PATCH] Make variables lower-case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order not to have conflicts with the system’s environment variables, custom variables are conventionally set in lower case. --- CHANGELOG.md | 4 ++++ random-password | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb9bbf..3044f8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## (unreleased) +### Internal + +- make shell variables lower-case to avoid conflicts with system variables + ## 1.0.0 (2017-11-17) Initial release diff --git a/random-password b/random-password index c127f62..e01ef9b 100755 --- a/random-password +++ b/random-password @@ -1,3 +1,3 @@ #!/bin/bash -LENGTH=${1:-32} -cat /dev/urandom | tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?=' | fold -w $LENGTH | head -n 1 | grep -i '[!@#$%^&*()_+{}|:<>?=]' +length=${1:-32} +cat /dev/urandom | tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?=' | fold -w $length | head -n 1 | grep -i '[!@#$%^&*()_+{}|:<>?=]'