plugins/base: `passgen()`
Fix `passgen()` to not need `tr`, remove one subshell, and eliminate a useless `echo`.pull/1930/head
parent
c8ed9a9da8
commit
ea8477198f
|
|
@ -62,9 +62,9 @@ function passgen() {
|
||||||
group 'base'
|
group 'base'
|
||||||
local -i i length=${1:-4}
|
local -i i length=${1:-4}
|
||||||
local pass
|
local pass
|
||||||
pass=$(echo $(for i in $(eval echo "{1..$length}"); do pickfrom /usr/share/dict/words; done))
|
pass="$(for i in $(eval "echo {1..$length}"); do pickfrom /usr/share/dict/words; done)"
|
||||||
echo "With spaces (easier to memorize): $pass"
|
echo "With spaces (easier to memorize): ${pass//$'\n'/ }"
|
||||||
echo "Without spaces (easier to brute force): $(echo $pass | tr -d ' ')"
|
echo "Without spaces (easier to brute force): ${pass//$'\n'/}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create alias pass to passgen when pass isn't installed or
|
# Create alias pass to passgen when pass isn't installed or
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue