Hi, guys.
Here's my take on oldyeller's problem:
Code: Select all
#!/bin/sh
# essai-oldyeller.sh # Using array instead of string.
####
declare -a TOPMARGIN=(1 2 3 36)
COMBOLIST2=""
M="0"
for i in `seq ${#TOPMARGIN[@]}`;do
COMBOLIST2="<item>\"${TOPMARGIN[$M]}\"</item>"
echo $COMBOLIST2
M="`expr $M + 1`"
done
Result is shown in attached pic.
Judging from the name of the variable, I'd say oldyeller is trying to place the
"top margin"
of some window on the screen!
I hope this helps. BFN.
musher0
~~~~~~~~~~
Edit - A couple of remarks.
1) The line < echo $COMBOLIST2 > is for checking during test. Remove when script
checks out ok or when not needed anymore.
2) The seq command is a spoiled little brat: it hates the zero (0). I had to use a
workaround, since arrays are counted starting from zero.