Last active
December 4, 2015 13:28
-
-
Save Spitfire1900/3f9a504a44687d1a39ae to your computer and use it in GitHub Desktop.
Securely provide password for a bash one-liner.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [ -z $pass ]; then | |
read -s -p "Enter Password: " pass | |
printf "\n\r" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage example:
$ source passsec.sh; echo $pass => will prompt for password securely and then echo the password.