diff --git a/fish_functions/filter_password_list.fish b/fish_functions/filter_password_list.fish new file mode 100644 index 0000000..4df2707 --- /dev/null +++ b/fish_functions/filter_password_list.fish @@ -0,0 +1,22 @@ +function filter_password_list +set arg_len $(count $argv) +if test $arg_len != 3; or test $argv[1] = "-h"; or test $argv[1] = "--help"; or test $argv[1] = "--h"; or test $argv[1] = "help" +echo "This function filters a passwords list for a specific length" +echo "" +echo "" +echo "USAGE:" +echo "filter_password_list /path/to/password/list length /path/to/save" +else +set extension_type $(echo $argv[3] | /sbin/rev | cut -d "." -f 1 | /sbin/rev) +for pw in $(cat $argv[1]) +set len $(string length $pw) +if test $len -ge $argv[2] +if test $extension_type = "md" +echo "- [ ] $pw" | tee  -a $argv[3] +else +echo $pw | tee -a $argv[3] +end +end +end +end +end