Shell Script: read from keyboard input








See the example script below:
#!/bin/bash
read    -p "Username: " username
read -s -p "Password: " password

echo "$username"
echo "$password"

-s option can hide the input string, it is used to input passwords.


No comments:

Post a Comment