Bartosz Wegrzyn <(E-Mail Removed)> wrote:
>i want this
>
>VAR="'a 1' 'b 2'"
>for a in $VAR
>do
>set $a
>echo "1:$1 2:$2"
>done
>
>but the output is wrong
>
>i was explecting "1:a 2:1" in first line but I got this
>
>[root@localhost /]# sh new
>1:'a 2:
>1:1' 2:
>1:'b 2:
>1:2' 2:
You could probably use an array to do it, but here's another
way
VAR="A 1 B 2"
set $VAR
while [ $# -gt 0 ] ; do
echo "1:$1 2:$2"
shift;shift;
done
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)
(E-Mail Removed)