Need to loop three variables

Hi,

I have a out from a command i need to grep a report. For that i need loop 3 variable for that. How i can loop need help.

Symmetrix ID             : 123456
Masking View Name     : Host16
Last updated at       : 04:13:06 PM on Thu Mar 17,2011
Initiator Group Name  : Host16
   Host Initiators
     {
       IG   : ig-01
       IG   : ig-02
     }
Port Group Name       : Host16
   Director Identification
     {
       FA-5F:1
       FA-6F:1
     }
Storage Group Name    : Host16
Sym Dev                                 Host
Name    Dir:P  Physical Device Name      Lun  Attr  Cap(MB)
------  -----  -----------------------  ----  ----  -------
0F44    05F:1  Not Visible                 0  (M)     34526
        06F:1  Not Visible                 0  (M)
0F47    05F:1  Not Visible                 1  (M)     34526
        06F:1  Not Visible                 1  (M)
10C1    05F:1  Not Visible                 8  (M)     34526
        06F:1  Not Visible                 8  (M)
10C3    05F:1  Not Visible                 9  (M)     34526
        06F:1  Not Visible                 9  (M)
10C5    05F:1  Not Visible                 a  (M)     34526
        06F:1  Not Visible                 a  (M)
10C7    05F:1  Not Visible                 b  (M)     34526
        06F:1  Not Visible                 b  (M)
1280    05F:1  Not Visible                 e  (M)     34526
        06F:1  Not Visible                 e  (M)

I want to loop

#To get Masking view and FA port
for f in `cat /home/DG-Group-Script/brick-sid-vmax.txt`
do
for g in `cat /home/DG-Group-Script/IG-vmax.txt`
do
symaccess -sid $f show view $g |grep "FA-"|head -1|sed -e "s/FA-//" > /home/DG-Group-Script/fa-port.txt
for i in `cat /home/DG-Group-Script/fa-port.txt`
do
echo $g-Masking View >>/home/DG-Group-Script/brick-dg-VMAX-report.txt
symaccess -sid $f show view $g |grep -i "$i"|awk '{print $1}'  >> /home/DG-Group-Script/brick-dg-VMAX-report.txt
symaccess -sid $f show view $g |grep -i "$i"|awk '{print $1}'  >/home/DG-Group-Script/222.txt
echo ****"DG-Group $f Vs Masking View Capacity $n"**** >> diff-report.txt
diff /home/DG-Group-Script/111.txt /home/DG-Group-Script/222.txt >> diff-report.txt
done
done
done

Your loop structure appears sound, what error/failure are you seeing?

You get three useless use of cat awards.

Also see Useless Use of Backticks.

If these files are large than a page or so each, they may be exceeding the maximum length of a variable on your system, resulting in the data being truncated before it reaches your loops.

The better way to do this is

while read LINE
do
...
done < inputfile

...which has no limits on sizes at all.

Sorry for the late replay I am held up on other job. Thanks for your replay. The script work fine I made a fault on input file.