Read in password instead of providing an argument

This commit is contained in:
RealStickman 2021-07-12 08:25:06 +02:00
parent 4359dfa302
commit 3e1fcedbb3
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
: '
# give password as argument
if [ $# -eq 1 ]; then
pass=$1
@ -11,14 +12,12 @@ else
echo "Please only insert one argument"
$(exit 1); echo "$?"
fi
'
# TODO make this work
: '
# prompt for password
echo -n Password:
echo -n "Password: "
read -s -r pass
echo
'
# go to home dir
cd "$HOME"

View File

@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
: '
# give password as argument
if [ $# -eq 1 ]; then
pass=$1
@ -11,6 +12,12 @@ else
echo "Please only insert one argument"
$(exit 1); echo "$?"
fi
'
# prompt for password
echo -n "Password: "
read -s -r pass
echo
# go to home dir
cd "$HOME"