From: Giacomo Boffi on
consider this example script
------------------------------------------------------------------------
#!/usr/bin
declare -A lista_canali
lista_canali=(\
['Rai Uno']=983 \
['Rai Due']=984 \
['Rai Tre']=986 \
['Rai 4']=75708)
select x in "${!lista_canali[@]}" ; do
printf "%s, %s\n" "$x" "${lista_canali[$x]}"
break
done
------------------------------------------------------------------------
that executed, replying 2 at my select prompt gives me
------------------------------------------------------------------------
1) Rai\ Uno
2) Rai\ Due
3) Rai\ Tre
4) Rai\ 4
#? 2
Rai\ Due, 984
------------------------------------------------------------------------
if i modify the above script as below,
------------------------------------------------------------------------
#!/usr/bin
declare -A lista_canali
lista_canali['Rai Uno']=983
lista_canali['Rai Due']=984
lista_canali['Rai Tre']=986
lista_canali['Rai 4']=75708
select x in "${!lista_canali[@]}" ; do
printf "%s, %s\n" "$x" "${lista_canali[$x]}"
break
done
------------------------------------------------------------------------
the output is
------------------------------------------------------------------------
1) Rai Due
2) Rai 4
3) Rai Uno
4) Rai Tre
#? 2
Rai 4, 75708
------------------------------------------------------------------------


i'm going to use syntax #2 in my scripts, but i'd like to understand
why i have the spurious(?) backslashes when i use syntax #1

thank in advance,
g
--
Una volta eravamo tutti alghe (e Agnosco era incazzato perche' non
poteva farsi circoncidere) -- Caldana, in IFQ