title: bash - compare 1 string/column value between two files
body: <p>I need to create VG using 1st column value from File1 and File2 if 2nd Column value of File1 equal to File2  . The problem  i face when File1 has more than 
  one lunid , please see the below my script but it can't compare  if i have more than </p>
  
  <p>File 1</p>
  
  <pre><code>vg1:4314
  vg2:4316 4315                      &lt;------------- here 2 lun id 4316 and 4315
  </code></pre>
  
  <p>File 2 </p>
  
  <pre><code>hdiskpower1:4314
  hdiskpower2:4315
  hdiskpower3:4316
  </code></pre>
  
  <p>This is what I tried:</p>
  
  <pre><code>IFS=":"
  while read  vgname Lunid 
  do 
  while read diskname lun
  do 
    if [ $lun == $Lunid ]
    then 
        mkvg -y $vgname $diskname
     fi
    done &lt; File2
    done &lt; File1 
  </code></pre>
  
  <p>Expected output is 
          mkvg vg1 hdiskpower1 </p>
  
  <pre><code>    mkvg vg2 hdiskpower2 hdiskpower3
  </code></pre>