For example, say I echo a line of text in shell script and I want to receive user input just right after the text (not in the next line). The are several ways to do it:
Method 1
echo "Enter a value: \c"
read value
Method 2
echo -n "Enter a value: "
read value
Method 3
read -p "Enter a value: " value
Leave a Reply