From 3ff230957c249a187e5d741bbc59ee6bf3c76904 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Sun, 20 May 2018 16:11:33 +0200 Subject: switching to bash, since zsh did not preserve PATH correctly in the subshell executing shuf --- bin/bin/makepass | 4 ++-- 1 file 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 @@ -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) -- cgit v1.2.3