Created
December 7, 2013 18:41
-
-
Save cowboy-cod3r/7846817 to your computer and use it in GitHub Desktop.
Bash: Prompt for Input
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
# Ask use for input | |
# -e - if standard input is coming from a terminal, readline is used to obtain the line | |
# -p - display prompt on stderr without a trailing new line | |
default="/usr/locol/etc/" | |
read -e -p "Enter the path to the file [${default}]: " FILEPATH | |
FILEPATH=${FILEPATH:-${default}} | |
echo $FILEPATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment