Skip to content

Commit

Permalink
Merge pull request #22 from alisezisli/main
Browse files Browse the repository at this point in the history
Password generator
  • Loading branch information
sachinl0har authored Oct 19, 2021
2 parents 457482f + 5265092 commit bffbb31
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Basic Programs/Bash Script/password-generator.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/bash

#Ask for length:
echo "Welcome to password generator."
echo "This script will fail if you type a non-integer value. Fix it ;)"
echo ""
printf "How many digits do you need?: "
#Read the input to "length" variable:
read length

tr -dc A-Za-z0-9 </dev/urandom | head -c $length ; echo ''

0 comments on commit bffbb31

Please sign in to comment.