Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (14 sloc) 284 Bytes
#!/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
You can’t perform that action at this time.