Hi,
I'm newbie with shell scripting and I'm in trouble with this:
prenotazioni=/root/script/dhcp/prenotazioni.txt
file=/root/script/dhcp/listaage.txt
for nomefile in $(cut -d: -f1 $file); do
ind=3
while [ "$ind" -lt 14 ]
do
comando="$"$ind
option[ind]=$(grep $nomefile $prenotazioni | awk 'BEGIN{RS="";FS="\n";OFS="|"}{gsub("\n","|",$0); print $0;}' | awk -F"|" '{print $comando}' | awk '{print $9}')
valore[ind]=$(grep $nomefile $prenotazioni | awk 'BEGIN{RS="";FS="\n";OFS="|"}{gsub("\n","|",$0); print $0;}' | awk -F"|" '{print $comando}' | awk '{print $11}')
ind=$(($ind+1))
done
echo ${option
[*]}
echo ${valore
[*]}
done
---------------------------------+++++++++++++++---------------
what I want to do is complete the arrays with the results of awk command each time with a different print, from $3 to $13 (instead of $comando)... but every time the result is the same, just like $0.
Any idea ?
PS: apologize me for my english...