shell script with input

Hi all,

Here is my shell script

#!/bin/sh
echo "What is your name"
read name
echo "What is your surname"
read surname

echo "Your name is:${name} and your surname is:${surname}"

How can I modify this script so that I input those two variables from console?Lets say my name is "first" and my surname is "last" . So when I run my script

./script.sh

and input first and last I get "Your name is:first and your surname is:last". Is it possible to modify the script so that it runs like this

./script.sh first last

and that I get same output "Your name is:first and your surname is:last" .. Thank you for your answers

Read a tutorial about shell scripting to learn how to use parameters:

http://www.unix.com/answers-frequently-asked-questions/13774-unix-tutorials-programming-tutorials-shell-scripting-tutorials.html

Regards

#!/bin/sh
echo "Your name is:$1 and your surname is:$2"

That simple, but do go read a tutorial or something at least.

Thank you for your posts