Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ask_string() #1-user ask string, #2-default variant
- {
- read -r -p "$1 [$2]:"
- if [ -z "$REPLY" ]; then
- if [ -n "$2" ]; then
- STR_RESULT=$2
- fi
- else
- STR_RESULT=$REPLY
- fi
- }
- ask_string "Select path" "/home/smallwolfie/test/testdir"
- echo $STR_RESULT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement