Skip to content

Commit

Permalink
plugins/base: shellcheck
Browse files Browse the repository at this point in the history
Fix `passgen()` to not need `tr`, remove one subshell, and eliminate a useless `echo`.
  • Loading branch information
gaelicWizard committed Sep 9, 2021
1 parent 272ff63 commit e201781
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/available/base.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function passgen ()
group 'base'
local -i i length=${1:-4}
local pass
pass="$(echo $(for i in $(eval "echo {1..$length}"); do pickfrom /usr/share/dict/words; done) )"
echo "With spaces (easier to memorize): $pass"
echo "Without spaces (easier to brute force): $(echo "$pass" | tr -d ' ')"
pass="$(for i in $(eval "echo {1..$length}"); do pickfrom /usr/share/dict/words; done)"
echo "With spaces (easier to memorize): ${pass//$'\n'/ }"
echo "Without spaces (easier to brute force): ${pass//$'\n'/}"
}

# Create alias pass to passgen when pass isn't installed or
Expand Down

0 comments on commit e201781

Please sign in to comment.