diff options
author | Dennis Eriksen <d@ennis.no> | 2018-05-20 16:11:33 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2018-05-20 16:11:33 +0200 |
commit | 3ff230957c249a187e5d741bbc59ee6bf3c76904 (patch) | |
tree | 61950fb847b329f8d2fb120ac45803a1ee5f32c3 | |
parent | Adding a license. (diff) | |
download | makepass-3ff230957c249a187e5d741bbc59ee6bf3c76904.tar.gz |
switching to bash, since zsh did not preserve PATH correctly in the subshell executing shuf
-rwxr-xr-x | bin/bin/makepass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/bin/makepass b/bin/bin/makepass index 52728f7..c7ec5d6 100755 --- a/bin/bin/makepass +++ b/bin/bin/makepass @@ -1,4 +1,4 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash # Filename: ~/bin/makepass # Purpose: Creating random passwords. # Authors: Dennis Eriksen <d@ennis.no> @@ -20,7 +20,7 @@ function makepass { local l=$1 # if $l is not a number, then exit - [[ ! $l = <-> ]] && [[ ! "$l" == "" ]] && echo "not a number" && return 1 + [[ ! $l =~ ^[0-9]+$ ]] && [[ ! "$l" == "" ]] && echo "not a number" && return 1 # if $1 is actually empty, set $l to random value for each output for i in {1..10}; do [ "$1" = "" ] && l=$(shuf -i 8-44 -n 1) |