I should put ENTER key value as a shell input to avoid shell waiting for user input.
case "$FRUIT" in
"apple") echo "Apple pie is quite tasty."
"banana") echo "I like banana nut bread."
"kiwi") echo "New Zealand is famous for kiwi."
echo | source ~/.bash_profile
The value is being exported in a subshell run by the pipeline. Use input redirection instead.
source ~/.bash_profile <<< ""
Any string could be used, since you don't appear to care about the actual value used, but an empty string is the equivalent of what
echo with no arguments produces. (All here strings implicitly end with a newline.)
If your shell does not support
<<<, you can use a POSIX-standard here document instead.
. ~/some_file <<EOF EOF