title: linux ethernet drivers product id, device id and address
body: <p>On a linux platform, I need to find the product_id, vendor_id and address of an interface given its name from cli. I am using the following commands to find it:</p>
  
  <pre><code># to find addr:
  pci_interface_addr0=$(ethtool -i $eth0 | grep -i bus-info | tail -c 8)
  
  # to find ids:
  complete_id=$(lspci -nvv | grep $pci_interface_addr0 | awk '{print $3}')
  vendor_id=$(echo $complete_id | cut -d \: -f 1)
  product_id=$(echo $complete_id | cut -d \: -f 2)
  </code></pre>
  
  <p>Is there is a better approach to this? Since i have hard coded values like tail -c 8 above.</p>
  
  <p>Can this be done in python? As the parent program is mostly a python module. </p>
  
  <p>Appreciate any good inputs!</p>