How to prompt for input & accept input in ONE line

hi,
am a new learner to shell programming.

i have a script which will prompt for user to key in their name & display their name afterwards.

script

echo "Pls enter your name:"
read name
echo "Your name is $name."

output

Pls enter your name:
Bob
Your name is Bob.

what are the modification to be done to the script in order for me to generate out the below output? (to accept the input in the SIMILAR line with the prompt, instead of the next line)

output

Pls enter your name: Bob
Your name is Bob.

ur help is much appreciated.
Thanks in advanced.

Change it to:

echo "Pls enter your name:\c"
read name
echo "Your name is $name."

regards,
rishi

Thank you very much, rishi. :slight_smile:
appreciate ur prompt reply.