diff options
-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) |