read variable after echo

Hi,

i want to create an user-friendly script where you are asked for two numbers. i would like that these two number to be separated with "--" for example, but i can't figure out how to do this.

for example

read -p "Insert lowest and highest value: " min ; echo -n "-- "; read max

so when i run the script

$>. script.sh
Insert lowest and highest value: 4 -- 10

instead, i get

$>. script.sh
Insert lowest and highest value: 4
-- 10

i would like the user to insert all the variables in the same line

any help is appreciated
thanks

$ read -p 'Insert lowest and highest value: ' min max
Insert lowest and highest value: 3 6
$ echo $min $max
3 6

You've got 2 read statements with an echo between them. Putting them on the same line in the script won't make them behave as a single read.
You'll have to read the entire "min -- max" line in a single read and then parse it to get your values.

Ok. Thanks!